Pure RFC 9002-style NewReno congestion controller.
Admission is reservation based: queued datagrams consume congestion credit until they are definitively failed, acknowledged, or declared lost.
Summary
Functions
Acknowledge packets given as {bytes, sent_at} pairs.
Declare lost bytes whose newest packet was sent at largest_sent_at.
Types
Functions
@spec available?(t(), non_neg_integer()) :: boolean()
@spec new(keyword()) :: initial_state()
@spec on_ack(t(), non_neg_integer()) :: t()
@spec on_loss(t(), non_neg_integer()) :: t()
@spec on_packets_acked(t(), [{non_neg_integer(), integer() | nil}]) :: t()
Acknowledge packets given as {bytes, sent_at} pairs.
Packets sent before the current recovery period started release their flight but do not grow the window (RFC 9002 section 7.3.2).
@spec on_packets_lost(t(), non_neg_integer(), integer() | nil, integer()) :: t()
Declare lost bytes whose newest packet was sent at largest_sent_at.
The window is reduced at most once per recovery period: losses of packets
sent before the period started at now only release their flight
(RFC 9002 section 7.3.2).
@spec pacing_delay(t(), non_neg_integer()) :: non_neg_integer()
@spec release(t(), non_neg_integer()) :: t()
@spec reserve(t(), non_neg_integer()) :: {:ok, t()} | {:error, :congestion_limited}