ZenWebsocket.Client.Callbacks (ZenWebsocket v0.8.0)

Copy Markdown View Source

handle_call/3 and handle_info/2 clause bodies for ZenWebsocket.Client.

The GenServer callbacks are defined on ZenWebsocket.Client so supervision and Gun message ownership stay with that process; this module holds the pattern-matched routing bodies those callbacks delegate to. Every function here takes and returns Client GenServer state and must not assume it runs in any other process.

Summary

Functions

Routes Client handle_call/3 requests. Clause order matches the original Client.

Routes Client handle_info/2 messages. Pins and fall-through match the original Client.

Functions

handle_call(arg1, from, state)

@spec handle_call(term(), GenServer.from(), map()) ::
  {:reply, term(), map()} | {:noreply, map()}

Routes Client handle_call/3 requests. Clause order matches the original Client.

handle_info(msg, state)

@spec handle_info(term(), map()) ::
  {:noreply, map()}
  | {:noreply, map(), {:continue, term()}}
  | {:stop, term(), map()}

Routes Client handle_info/2 messages. Pins and fall-through match the original Client.