Xirsys.Sockets.Pipeline.Tier (xturn_sockets v2.2.1)

View Source

One compiled pipeline tier: accumulator, handler, and dispatch strategy.

iex> tier = %Xirsys.Sockets.Pipeline.Tier{
...>   accumulator: Xirsys.Sockets.Accumulator.Raw,
...>   accumulator_opts: [],
...>   handler: :my_handler
...> }
iex> tier.dispatch
:inline
iex> tier.pool_size
nil

What problem this solves

Each pipeline layer needs a frozen snapshot of which accumulator module, handler module, and dispatch strategy (:inline, :task, or :pool) the engine will use at runtime. %Tier{} is that snapshot after compile-time tier/2 expansion.

RFCs

No STUN/TURN RFC; framing/dispatch infrastructure for XTurn listeners.

Summary

Types

t()

Runtime tier record produced by Pipeline.tier/2.

Types

t()

@type t() :: %Xirsys.Sockets.Pipeline.Tier{
  accumulator: module(),
  accumulator_opts: keyword(),
  dispatch: :inline | :task | :pool,
  handler: module(),
  pool_size: pos_integer() | nil,
  pool_supervisor: atom(),
  task_supervisor: atom()
}

Runtime tier record produced by Pipeline.tier/2.

Fields

  • :accumulator - Xirsys.Sockets.Accumulator module for this tier
  • :accumulator_opts - keyword list passed to accumulator.init/1
  • :handler - Xirsys.Sockets.Handler implementation module
  • :dispatch - :inline (same process), :task, or :pool
  • :pool_size - max pool children when dispatch: :pool; nil uses config
  • :task_supervisor - named supervisor for dispatch: :task
  • :pool_supervisor - named supervisor for dispatch: :pool