ExLibSRT.Connection.Handler behaviour (ExLibSRT v0.2.1)

Copy Markdown View Source

Handler behaviour for incoming connection messages.

Summary

Callbacks

Invoked when a new payload arrives.

Invoked when a connection gets disconnected .

Types

connection_id()

@type connection_id() :: non_neg_integer()

state()

@type state() :: any()

stream_id()

@type stream_id() :: String.t()

t()

@type t() :: module() | struct()

Callbacks

handle_data(binary, state)

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

Invoked when a new payload arrives.

handle_disconnected(state)

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

Invoked when a connection gets disconnected .

init(t)

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