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.
def __init__(self, handler, timeout=None):

Starts up a deferred-yielding loop that runs the queue. This method can only be run once, by the constructor upon instantiation.

def isRunning(self):

Returns True if the queue is running, False otherwise.

def shutdown(self):

Initiates a shutdown of the queue by putting a lowest-possible priority None object onto the priority heap.

ReturnsA deferred that fires when my handler has shut down, with a list of any items left unhandled in the queue.
def put(self, item):

Put an item into my heap, only if the queue is running. Otherwise ignored.

def cancelSeries(self, series):

Cancels any pending items in the specified series, unceremoniously removing them from the queue.

def cancelAll(self):

Cancels all pending items, unceremoniously removing them from the queue.

def subscribe(self, consumer):

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.

API Documentation for AsynQueue, generated by pydoctor at 2022-11-17 13:13:24.