diff options
Diffstat (limited to 'test/ws_send_many_handler.erl')
-rw-r--r-- | test/ws_send_many_handler.erl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/ws_send_many_handler.erl b/test/ws_send_many_handler.erl index ee386ba..bd67814 100644 --- a/test/ws_send_many_handler.erl +++ b/test/ws_send_many_handler.erl @@ -12,20 +12,16 @@ init(_Any, _Req, _Opts) -> {upgrade, protocol, cowboy_websocket}. -websocket_init(_TransportName, Req, _Opts) -> +websocket_init(_TransportName, Req, Sequence) -> Req2 = cowboy_req:compact(Req), erlang:send_after(10, self(), send_many), - {ok, Req2, undefined}. + {ok, Req2, Sequence}. websocket_handle(_Frame, Req, State) -> {ok, Req, State}. -websocket_info(send_many, Req, State) -> - {reply, [ - {text, <<"one">>}, - {text, <<"two">>}, - {text, <<"seven!">>} - ], Req, State}. +websocket_info(send_many, Req, State = [{sequence, Sequence}]) -> + {reply, Sequence, Req, State}. websocket_terminate(_Reason, _Req, _State) -> ok. |