-
-
Save rightfold/bcac1f8599c44e05b7f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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