View Source ExLibSRT.Connection.Handler behaviour (ExLibSRT v0.1.3)

Handler behaviour for incoming connection messages.

Summary

Callbacks

Invoked when a connection gets fully established.

Invoked when a new payload arrives.

Invoked when a connection gets disconnected .

Types

@type connection_id() :: non_neg_integer()
@type state() :: any()
@type stream_id() :: String.t()
@type t() :: module() | struct()

Callbacks

Link to this callback

handle_connected(connection_id, stream_id, state)

View Source
@callback handle_connected(connection_id(), stream_id(), state()) ::
  {:ok, state()} | :stop

Invoked when a connection gets fully established.

Link to this callback

handle_data(binary, state)

View Source
@callback handle_data(binary(), state()) :: {:ok, state()} | :stop

Invoked when a new payload arrives.

Link to this callback

handle_disconnected(state)

View Source
@callback handle_disconnected(state()) :: :ok

Invoked when a connection gets disconnected .

@callback init(t()) :: state()