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:
parent
5fa5ba8ca4
commit
e2d5c268aa
3 changed files with 29 additions and 4 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue