Bounded frontend output retention and acknowledgement correlation state.
Summary
Functions
Accepts a correlated acknowledgement or rejects stale generation and sequence values.
Advances after the current frame is admitted and returns the admitted frame.
Consumes the matching retry token and rejects stale timer messages.
Drops one admitted control batch.
Returns whether any control batch is retained.
Retains a first unwritable frame or replaces the single coalesced successor.
Returns whether the current unwritable interval reached its failure budget.
Marks the current admission unwritable and correlates one retry token.
Returns empty pressure state.
Returns the next retained control batch in deterministic resource-key order.
Drops retained output and requires acknowledgements from the next generation.
Coalesces the latest unwritable out-of-band control batch by resource key.
Returns whether a retry timer is already correlated.
Clears the unwritable interval after every retained batch drains.
Returns bounded retained-byte and acknowledgement diagnostics.
Types
@type control_key() :: non_neg_integer() | {non_neg_integer(), non_neg_integer()}
@type stats() :: %{ current_frame_seq: non_neg_integer() | nil, replacement_frame_seq: non_neg_integer() | nil, current_bytes: non_neg_integer(), replacement_bytes: non_neg_integer(), retained_bytes: non_neg_integer(), control_batches: non_neg_integer(), control_bytes: non_neg_integer(), total_retained_bytes: non_neg_integer(), minimum_ack_generation: non_neg_integer(), last_admitted_generation: non_neg_integer(), last_admitted_frame_seq: non_neg_integer(), last_applied_generation: non_neg_integer(), last_applied_frame_seq: non_neg_integer() }
@type t() :: %MingaEditor.Frontend.Manager.OutputPressure{ controls: %{required(control_key()) => binary()}, current: MingaEditor.Frontend.Manager.PendingFrame.t() | nil, last_admitted_frame_seq: non_neg_integer(), last_admitted_generation: non_neg_integer(), last_applied_frame_seq: non_neg_integer(), last_applied_generation: non_neg_integer(), minimum_ack_generation: non_neg_integer(), replacement: MingaEditor.Frontend.Manager.PendingFrame.t() | nil, retry_token: reference() | nil, unwritable_since: integer() | nil }
Functions
@spec acknowledge(t(), non_neg_integer(), non_neg_integer()) :: {:accepted, t()} | :stale
Accepts a correlated acknowledgement or rejects stale generation and sequence values.
@spec admitted(t()) :: {MingaEditor.Frontend.Manager.PendingFrame.t(), t()}
Advances after the current frame is admitted and returns the admitted frame.
Consumes the matching retry token and rejects stale timer messages.
@spec control_admitted(t(), control_key()) :: t()
Drops one admitted control batch.
Returns whether any control batch is retained.
@spec enqueue(t(), MingaEditor.Frontend.Manager.PendingFrame.t()) :: {:attempt, t()} | {:coalesced, t()}
Retains a first unwritable frame or replaces the single coalesced successor.
@spec expired?(t(), integer(), non_neg_integer()) :: boolean()
Returns whether the current unwritable interval reached its failure budget.
Marks the current admission unwritable and correlates one retry token.
@spec new() :: t()
Returns empty pressure state.
@spec next_control(t()) :: {control_key(), binary()} | nil
Returns the next retained control batch in deterministic resource-key order.
@spec require_recovery(t(), MingaEditor.Frontend.Manager.PendingFrame.t()) :: t()
Drops retained output and requires acknowledgements from the next generation.
@spec retain_control(t(), control_key(), binary()) :: t()
Coalesces the latest unwritable out-of-band control batch by resource key.
Returns whether a retry timer is already correlated.
Clears the unwritable interval after every retained batch drains.
Returns bounded retained-byte and acknowledgement diagnostics.