Portals wire protocol v1: frame tags, default limits, and the frame validation rules shared by every SDK implementation.
See protocol/v1.md for the full specification. This module encodes
the frame tag registry and default limits as authoritative Elixir
constants; protocol/v1.md must stay in sync with these values.
Summary
Functions
Required and optional field arity for each frame, used to validate a decoded envelope.
Validate a decoded frame envelope: [tag | fields].
Types
@type frame_name() ::
:hello
| :ready
| :call
| :return
| :error
| :cancel
| :callback
| :callback_return
| :callback_error
| :message
| :stream_data
| :credit
| :half_close
| :ping
| :pong
| :shutdown
@type limits() :: %{ max_frame_size: pos_integer(), max_nesting_depth: pos_integer(), max_collection_length: pos_integer(), max_metadata_size: pos_integer(), max_callback_depth: pos_integer(), max_in_flight_callbacks: pos_integer(), max_in_flight_requests: pos_integer(), max_stream_byte_credit: pos_integer(), max_queued_stream_frames: pos_integer() }
Functions
@spec arity(frame_name()) :: {non_neg_integer(), non_neg_integer() | :infinity}
Required and optional field arity for each frame, used to validate a decoded envelope.
@spec default_limits() :: limits()
@spec frame_name(pos_integer()) :: {:ok, frame_name()} | :error
@spec frame_tag(frame_name()) :: pos_integer()
@spec validate_envelope(list()) :: {:ok, {frame_name(), list()}} | {:error, term()}
Validate a decoded frame envelope: [tag | fields].
Returns {:ok, {frame_name, fields}} or {:error, reason}. Does not
interpret field semantics beyond arity and the tag itself; that is the
responsibility of Portals.Connection and its equivalents in each SDK.
@spec version() :: pos_integer()