View Source nova_websocket behaviour (nova v0.10.4)
Summary
Types
-type call_result() :: {ok, State :: map()} | {ok, State :: map(), hibernate} | {reply, OutFrame :: cow_ws:frame() | [OutFrame :: cow_ws:frame()], State :: map()} | {reply, OutFrame :: cow_ws:frame() | [OutFrame :: cow_ws:frame()], State :: map(), hibernate} | {stop, State :: map()}.
-type in_frame() :: ping | pong | {text | binary | ping | pong, binary()}.
-type reason() :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()}.
Callbacks
-callback websocket_handle(Frame :: in_frame(), State :: map()) -> call_result().
-callback websocket_info(Info :: any(), State :: map()) -> call_result().
-callback websocket_init(State :: map()) -> Result :: call_result().