Lane bookkeeping shared between LaneSerializer, SessionEngine, and
Quic.Session.
A push from the Phoenix socket is one of:
{:text | :binary, iodata}(or list of pushes) routed to control lane0- A lane container (
"L"or causal-barrier"B") produced byPhoenixWebTransport.LaneSerializer {:datagram, iodata}or{:datagram, :text | :binary, iodata}for opt-in RFC 9297 unreliable datagrams
Summary
Functions
The control lane id.
Decodes a typed datagram payload.
Wraps a control lane JSON payload with a causal barrier wait map
%{slot => expected_seq} as ["__wt_barrier", wait_map, original_json].
Encodes a typed datagram payload with a 1-byte type tag (0 text, 1 binary).
Turns a single socket push into normalized lane frames.
Turns one push or a list of pushes into normalized lane frames.
Maps a lane onto one of max_lanes stream slots. Lane 0 keeps its own
stream; component lanes share the remaining slots round-robin.
Shortest message first on the RFC 9218 urgency scale (0 most urgent, 7 least; erlang_quic reserves 0 for its own control streams).
Types
@type lane_frame() :: {non_neg_integer(), {:text | :binary, binary()}} | {:barrier, 0, {:text, binary()}, [pos_integer()]} | {:datagram, {:text | :binary, binary()}}
Functions
@spec control() :: non_neg_integer()
The control lane id.
Decodes a typed datagram payload.
@spec encode_barrier(%{optional(non_neg_integer()) => pos_integer()}, binary()) :: binary()
Wraps a control lane JSON payload with a causal barrier wait map
%{slot => expected_seq} as ["__wt_barrier", wait_map, original_json].
Encodes a typed datagram payload with a 1-byte type tag (0 text, 1 binary).
@spec frames_for_push(push()) :: [lane_frame()]
Turns a single socket push into normalized lane frames.
@spec frames_for_pushes(push() | [push()]) :: [lane_frame()]
Turns one push or a list of pushes into normalized lane frames.
@spec slot_for(non_neg_integer(), pos_integer()) :: non_neg_integer()
Maps a lane onto one of max_lanes stream slots. Lane 0 keeps its own
stream; component lanes share the remaining slots round-robin.
@spec urgency(non_neg_integer()) :: 1..7
Shortest message first on the RFC 9218 urgency scale (0 most urgent, 7 least; erlang_quic reserves 0 for its own control streams).