pub struct IngressQueue { /* private fields */ }Expand description
Implementations§
Source§impl IngressQueue
impl IngressQueue
Sourcepub fn submit(
&mut self,
commands: Vec<Command>,
tick_disabled: bool,
) -> Vec<Receipt>
pub fn submit( &mut self, commands: Vec<Command>, tick_disabled: bool, ) -> Vec<Receipt>
Submit a batch of commands to the queue.
Returns one Receipt per input command. Commands are accepted
in order until the queue is full; remaining commands receive
QueueFull receipts. If tick_disabled is true, all commands
are rejected with TickDisabled.
Arrival sequence numbers are assigned from a monotonic counter
that persists across submit calls, overwriting whatever value
the caller may have set on Command::arrival_seq.
Sourcepub fn drain(&mut self, current_tick: TickId) -> DrainResult
pub fn drain(&mut self, current_tick: TickId) -> DrainResult
Drain the queue, filtering expired commands and sorting the rest.
A command is expired if cmd.expires_after_tick < current_tick.
A command with expires_after_tick == current_tick is valid
during that tick.
Returns a DrainResult containing the sorted valid commands
and receipts for expired commands.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Discard all pending commands.
Called during TickEngine::reset() so
stale commands from previous ticks don’t survive a reset.