Expand description
Command queue for deferred execution with priority levels.
Structs§
- Command
Queue - A priority-aware command queue.
- Queued
Command - A single command waiting in the queue.
Enums§
- Command
Priority - Priority levels for queued commands.
Functions§
- clear_
queue - Remove all commands from the queue.
- command_
count - Return the number of commands currently in the queue.
- command_
queue_ to_ json - Produce a minimal JSON representation of the queue.
- commands_
by_ priority - Collect references to all commands of a given priority.
- dequeue
- Remove and return the highest-priority (lowest rank) command.
Returns
Noneif the queue is empty. - drain_
all - Remove and return all commands, ordered by priority then sequence.
- enqueue
- Enqueue a single command with the given label and priority. Returns the assigned command id.
- enqueue_
batch - Enqueue a batch of
(label, priority)pairs. Returns the assigned ids. - has_
priority - Return
trueif there is at least one command of the given priority. - is_
queue_ empty - Return
trueif the queue has no commands. - max_
queue_ depth - Return the historical maximum queue depth.
- new_
command_ queue - Create a new, empty
CommandQueue. - peek_
next - Peek at the next command without removing it.
- total_
enqueued - Return the total number of commands ever enqueued.