0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Fix timer-sent events in the websocket example

This commit is contained in:
Loïc Hoguin 2016-08-11 11:06:03 +02:00
parent 5fa5ba8ca4
commit e2d5c268aa
3 changed files with 29 additions and 4 deletions

View file

@ -32,6 +32,12 @@
| {module(), Req, any(), timeout()}
| {module(), Req, any(), timeout(), hibernate}
when Req::cowboy_req:req().
-callback websocket_init(Req, State)
-> {ok, Req, State}
when Req::cowboy_req:req(), State::any().
-optional_callbacks([websocket_init/2]).
-callback websocket_handle({text | binary | ping | pong, binary()}, Req, State)
-> {ok, Req, State}
| {ok, Req, State, hibernate}