Skip to content

Instantly share code, notes, and snippets.

@kennystone
Created July 1, 2011 16:03
Show Gist options
  • Save kennystone/1058836 to your computer and use it in GitHub Desktop.
Save kennystone/1058836 to your computer and use it in GitHub Desktop.
js -> comet
api_event(start_comet, _, [ComentID]) ->
wf:comet(fun() -> up_loop() end, CometID);
api_event(send_msg, _, [CometID, Msg]) ->
wf:send(CometID, {msg, Msg}).
up_loop() ->
receive
{msg, Msg} -> error_logger:info_msg("OHAI JAVASCRIPT MSG ~p",[Msg])
end,
wf:flush(),
up_loop().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment