asynqueue.base.Queue(object)
class documentation
Part of asynqueue.base
(View In Hierarchy)
I am an asynchronous priority queue. Construct me with an item handler
that can be called with each item from the queue and call shutdown
when
I'm done.
Put anything you like in the queue except None
objects.
Those are reserved for triggering a queue shutdown.
You will probably use a TaskQueue
instead of
me directly.
Method | __init__ | Starts up a deferred-yielding loop that runs the queue. This method can only be run once, by the constructor upon instantiation. |
Method | isRunning | Returns True if the queue is running, False
otherwise. |
Method | shutdown | Initiates a shutdown of the queue by putting a lowest-possible priority
None object onto the priority heap. |
Method | put | Put an item into my heap, only if the queue is running. Otherwise ignored. |
Method | cancelSeries | Cancels any pending items in the specified series, unceremoniously removing them from the queue. |
Method | cancelAll | Cancels all pending items, unceremoniously removing them from the queue. |
Method | subscribe | Subscribes the supplied provider of IConsumer to updates on
the number of items queued whenever it goes up or down. |
Starts up a deferred-yielding loop that runs the queue. This method can only be run once, by the constructor upon instantiation.
Initiates a shutdown of the queue by putting a lowest-possible priority
None
object onto the priority heap.
Returns | A deferred that fires when my handler has shut down, with a list of any items left unhandled in the queue. |
Cancels any pending items in the specified series, unceremoniously removing them from the queue.
Subscribes the supplied provider of IConsumer
to updates on
the number of items queued whenever it goes up or down.
The figure is the integer number of calls currently pending, i.e., the number of items that have been queued up but haven't yet been handled plus those that have been called but haven't yet returned a result.