August 2019
Beginner
482 pages
12h 56m
English
The Queue module provides a set of queue structures, which are efficient at adding and releasing values. A classic Queue object, also known as first-in, first-out (FIFO), provides a convenient way to manage things such as tasks. You don't need to worry about order of instances, as the first submitted task will be retrieved first, and so on.
Queues have a maxsize argument and will raise an exception if you try to add more elements than the maxsize value. They also have the .task_done() method, which you can run from your code, indicating that the task is done and allowing Queue to safely drop it, thus decreasing the number of tasks in the queue.
Read now
Unlock full access