Skip to main content

Module work_queue

Module work_queue 

Source
Expand description

A bounded, priority-aware work queue for media pipeline tasks.

WorkQueue holds WorkItems ordered by priority (higher value = more urgent). QueueStats tracks lifetime throughput counters.

§Examples

use oximedia_core::work_queue::{WorkItem, WorkQueue};

let mut q: WorkQueue<u32> = WorkQueue::new(8);
q.push(WorkItem::new(42_u32, 10)).expect("queue not full");
q.push(WorkItem::new(99_u32, 20)).expect("queue not full");
// Highest-priority item comes out first.
let item = q.pop().expect("queue not empty");
assert_eq!(item.payload, 99_u32);

Structs§

QueueStats
Lifetime throughput statistics for a WorkQueue.
WorkItem
A single work item carrying an arbitrary payload and a scheduling priority.
WorkQueue
A bounded, priority-ordered work queue.

Enums§

QueueError
Error returned by queue operations.