Skip to main content

Module command_queue

Module command_queue 

Source
Expand description

Command queue for deferred execution with priority levels.

Structs§

CommandQueue
A priority-aware command queue.
QueuedCommand
A single command waiting in the queue.

Enums§

CommandPriority
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 None if 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 true if there is at least one command of the given priority.
is_queue_empty
Return true if 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.