Buckaroo.Socket behaviour (buckaroo v0.3.2) View Source
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
Specs
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.
Specs
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
Specs
Incoming frames.
Specs
Incoming process messages.
Specs
init(conn :: Plug.Conn.t(), state :: state) :: result(state) when state: any()
Initialize the websocket.
Passes the connection and the given state.
Specs
Websocket termination.