Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created August 25, 2013 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightfold/bcac1f8599c44e05b7f8 to your computer and use it in GitHub Desktop.
Save rightfold/bcac1f8599c44e05b7f8 to your computer and use it in GitHub Desktop.
start_link() ->
Pid = spawn_link(?MODULE, init, []),
{ok, Pid}.
init() ->
loop(0).
loop(N) ->
receive
{get_unique, ReplyTo} ->
ReplyTo ! {unique, N, self()},
?MODULE:loop(N + 1)
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment