Created
July 1, 2011 16:03
-
-
Save kennystone/1058836 to your computer and use it in GitHub Desktop.
js -> comet
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
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