Bounded local connection-ID issuance, registration, and retirement.
The caller supplies CID material and a registration identity scoped to its connection generation. Registration acknowledgment makes an issuance ready; only publication after a successful local send advances the sent watermark. Retired entries are removed rather than retained as connection history.
Summary
Functions
Commit first transmission after successful registration and local send.
Whether one refill can be reserved without duplicating pending work.
Acknowledge the exact route registration and return its ready frame.
Reserve one route registration; this does not authorize advertisement.
Retire once, returning the route to remove without retaining its token.
Types
@type frame() :: %{ type: :new_connection_id, sequence: non_neg_integer(), retire_prior_to: 0, cid: binary(), token: binary() }
@type pending() :: %{ sequence: non_neg_integer(), cid: binary(), token: binary(), registration_id: term(), status: :registering | :ready }
@type registration() :: %{ sequence: non_neg_integer(), cid: binary(), token: binary(), registration_id: term() }
@opaque t()
Functions
@spec published(t(), non_neg_integer()) :: {:ok, t()} | {:error, atom()}
Commit first transmission after successful registration and local send.
Whether one refill can be reserved without duplicating pending work.
Acknowledge the exact route registration and return its ready frame.
Reserve one route registration; this does not authorize advertisement.
@spec retire(t(), non_neg_integer(), binary()) :: {:ok, t(), binary() | nil} | {:error, :invalid_connection_id_retirement}
Retire once, returning the route to remove without retaining its token.