job-queue
Bounded queue with sentinel-based shutdown used between pipeline workers.
A thread-safe FIFO queue with a fixed capacity.
Wraps queue.Queue with a typed interface and the sentinel pattern
for clean shutdown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capacity
|
int
|
Maximum number of items the queue can hold. Producers
block on |
required |
get()
put(item)
Put an item. Blocks if the queue is full.
put_stop()
Signal that no more items will be produced.
Puts the STOP sentinel. Blocks if the queue is full — this ensures the sentinel is never lost even under backpressure.
task_done()
Mark the last item returned by get() as processed.