mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 12:40:25 +00:00
Update the cowboy_websocket_handler specs
We can send many payloads at once.
This commit is contained in:
parent
45dd67741f
commit
7142016955
1 changed files with 5 additions and 4 deletions
|
@ -50,6 +50,7 @@
|
|||
|
||||
-type opts() :: any().
|
||||
-type state() :: any().
|
||||
-type payload() :: {text | binary | ping | pong, binary()}.
|
||||
-type terminate_reason() :: {normal, closed}
|
||||
| {normal, timeout}
|
||||
| {error, closed}
|
||||
|
@ -66,15 +67,15 @@
|
|||
-callback websocket_handle({text | binary | ping | pong, binary()}, Req, State)
|
||||
-> {ok, Req, State}
|
||||
| {ok, Req, State, hibernate}
|
||||
| {reply, {text | binary | ping | pong, binary()}, Req, State}
|
||||
| {reply, {text | binary | ping | pong, binary()}, Req, State, hibernate}
|
||||
| {reply, payload() | [payload()], Req, State}
|
||||
| {reply, payload() | [payload()], Req, State, hibernate}
|
||||
| {shutdown, Req, State}
|
||||
when Req::cowboy_req:req(), State::state().
|
||||
-callback websocket_info(any(), Req, State)
|
||||
-> {ok, Req, State}
|
||||
| {ok, Req, State, hibernate}
|
||||
| {reply, {text | binary | ping | pong, binary()}, Req, State}
|
||||
| {reply, {text | binary | ping | pong, binary()}, Req, State, hibernate}
|
||||
| {reply, payload() | [payload()], Req, State}
|
||||
| {reply, payload() | [payload()], Req, State, hibernate}
|
||||
| {shutdown, Req, State}
|
||||
when Req::cowboy_req:req(), State::state().
|
||||
-callback websocket_terminate(terminate_reason(), cowboy_req:req(), state())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue