Queue Modules

queue

Synchronized FIFO, LIFO and priority queues for thread coordination, plus SimpleQueue. Prefer nonblocking or timeout operations in bounded examples; task tracking is available on Queue.

Formal Syntax & Structure

python syntaxpython
queue

Return Value

module

Module object available through import.

Working Example

Example Snippetpython
import queueq=queue.Queue(); q.put_nowait("job"); item=q.get_nowait(); q.task_done()print(item)
Python Reference