View Source Wobserver.Web.Client (Wobserver NG v1.14.0)
Modules handles WebSocket connects to the client.
Link to this section Summary
Functions
Handles the command
given by the websocket interface.
Handles process messages.
Starts the websocket client.
Initialize the websocket connection.
Gracefully handles websocked terminate.
Handles incoming messages from the websocket client.
Handles incoming messages from processes.
Initialize the websocket connection by calling the implementing client.
Link to this section Functions
@spec client_handle(atom() | [atom()], state :: map()) :: {:reply, atom() | [atom()], map(), map()} | {:reply, atom() | [atom()], map()} | {:noreply, map()}
Handles the command
given by the websocket interface.
The current state
is passed and can be modified.
Returns a map as state.
Handles process messages.
Should not be used, the do
is ignored and the state
is returned unmodified.
@spec client_init() :: {:ok, map()}
Starts the websocket client.
Returns a map as state.
Initialize the websocket connection.
Gracefully handles websocked terminate.
The reason
, req
and state
are ignored.
@spec websocket_handle( {:text, String.t()}, state :: any() ) :: {:reply, {:text, String.t()}, any()} | {:ok, any()}
Handles incoming messages from the websocket client.
The message
is parsed and passed on to the client, which responds with an update state
and possible reply.
@spec websocket_info(message :: any(), state :: any()) :: {:reply, {:text, String.t()}, any()} | {:ok, any()}
Handles incoming messages from processes.
The message
is passed on to the client, which responds with an update state
and possible reply.
Initialize the websocket connection by calling the implementing client.
The req
cowboy request is passed along to the client.
The type
and options
are passed, but unused in the setup.