Module uri_server

Uri Server generates uris suitable for thing ids.

Copyright © 2009 Mr Buzz, Inc.

Behaviours: gen_server.

Authors: Jacob Perkins.

Description

Uri Server generates uris suitable for thing ids. It basically exists because random:uniform is process oriented and does not work well if numbers are generated in many different processes. For example, each yaws request is a separate process, and so there is a high likelihood of processes being seeded the same, which causes duplicate uri generation. That won't happen with uri_server because it is a locally unique process.

Function Index

start_link/2Equivalent to start_link(Name, Table, [], 30).
start_link/3Equivalent to start_link(Name, Table, Prefix ++ ":", 30).
start_link/4Equivalent to gen_server:start_link({local, Name}, uri_server, {Table, Prefix, Len}, []).
uri/1Generate a new uri.

Function Details

start_link/2

start_link(Name::atom(), Table::atom()) -> {ok, pid()}

Equivalent to start_link(Name, Table, [], 30).

start_link/3

start_link(Name::atom(), Table::atom(), Prefix::string()) -> {ok, pid()}

Equivalent to start_link(Name, Table, Prefix ++ ":", 30).

start_link/4

start_link(Name::atom(), Table::atom(), Prefix::string(), Len::integer()) -> {ok, pid()}

Equivalent to gen_server:start_link({local, Name}, uri_server, {Table, Prefix, Len}, []).

uri/1

uri(Name::atom()) -> string()

Generate a new uri.


Generated by EDoc, Jul 14 2009, 14:06:01.