Skip to content

Instantly share code, notes, and snippets.

@johntyree
Created May 2, 2011 10:19
Show Gist options
  • Save johntyree/951408 to your computer and use it in GitHub Desktop.
Save johntyree/951408 to your computer and use it in GitHub Desktop.
loop(S = #state{server=Server, to_go=[T|Next]}) ->
receive
{Server, Ref, cancel} ->
Server ! {Ref, ok}
after T*1000 ->
if Next =:= [] ->
Server ! {done, S#state.name};
Next =/= [] ->
loop(S#state{to_go=Next})
end
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment