Known subclasses: mcmandelbrot.test.testbase.MockWireWorker

Implements interfaces: IWorker

I implement an IWorker that runs tasks in the Twisted main loop.

I run each tasks.Task one at a time but in a well-behaved non-blocking manner. If the task callable doesn't return a Deferred, it better get its work done fast. You just can't get away with blocking in the Twisted main loop.

You can supply a series keyword containing a list of one or more task series that I am qualified to handle.

This class was mostly written for testing during development, but it helped keep the basic functions of a worker in mind. And who knows; it might be useful where you want the benefits of priority queueing without leaving the Twisted mindset even for a moment.

Method __init__ Constructs an instance of me with a util.DeferredLock.
Method setResignator Undocumented
Method run Implements IWorker.run, running the task in the main thread. The task callable must not block.
Method stop Implements IWorker.stop.
Method crash There's no point to implementing this because the Twisted main loop will block along with any task you give this worker.
def __init__(self, series=[], raw=False):

Constructs an instance of me with a util.DeferredLock.

ParametersseriesA list of one or more task series that this particular instance of me is qualified to handle.
rawSet True if you want raw iterators to be returned instead of iteration.Deferator instances. You can override this with the same keyword set False in a call.
def setResignator(self, callableObject):
Undocumented
def run(self, task):

Implements IWorker.run, running the task in the main thread. The task callable must not block.

def stop(self):

Implements IWorker.stop.

def crash(self):

There's no point to implementing this because the Twisted main loop will block along with any task you give this worker.

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