Skip to content

Instantly share code, notes, and snippets.

@darkua
Created December 2, 2009 06:53
Show Gist options
  • Save darkua/247001 to your computer and use it in GitHub Desktop.
Save darkua/247001 to your computer and use it in GitHub Desktop.
-module(spawn_example).
-export([
start/0,
loop/0
]).
start()->
Pid = spawn(fun()->?MODULE:loop() end),
register(bot,Pid).
loop()->
receive
hello ->
io:format("Hot swapping really rocks!~n",[]);
_->
void
end,
?MODULE:loop().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment