Executable ordinary-message selective receive, with finite supplied conditions.
:begin_receive restarts at the oldest retained message. :inspect tests the
next message against ordered clauses and guards, retaining misses. Arrivals
append; a suspended receive resumes at its cursor. :timeout is an observation
allowed only for a finite timeout after all present messages were rejected.
Its numeric value is not a cost or elapsed-time guarantee. Selection removes
only the first eligible message. Post-return arrivals remain in the queue.
Conditions bound all initial/arriving messages, including unrelated messages, and total counters across repeated receives. No receive optimization or inference from initial queue length is used. Checks remain supplied-model evidence, not source correspondence or a cost/progress theorem.
Summary
Types
@type spec() :: %{ clauses: list(), message_size: ReductionBounds.RpcTerm.Size.t(), limits: map(), timeout: non_neg_integer() | :infinity }
@type state() :: map()