View Source Buckaroo.Socket behaviour (buckaroo v0.4.2)
A simple websocket implementation.
Link to this section Summary
Callbacks
Incoming frames.
Incoming process messages.
Initialize the websocket.
Websocket termination.
Link to this section Types
@type frame() :: :ping | :pong | {:text | :binary | :ping | :pong, binary()}
Websocket frames.
Note that there is no need to send pong frames back as Cowboy does it automatically for you.
@type result(state) :: {:ok, state} | {:ok, state, :hibernate} | {:reply, frame() | [frame()], state} | {:reply, frame() | [frame()], state, :hibernate} | {:stop, state}
Websocket callback result.
Link to this section Callbacks
Incoming frames.
Incoming process messages.
@callback init(conn :: Plug.Conn.t(), state :: state) :: result(state) when state: any()
Initialize the websocket.
Passes the connection and the given state.
Websocket termination.