asynqueue.test.testbase.MockWorker(MsgBase)
class documentation
Part of asynqueue.test.testbase
(View In Hierarchy)
Implements interfaces: asynqueue.interfaces.IWorker
Method | __init__ | Undocumented |
Method | setResignator | Registers the supplied callableObject to be called if the worker deems it necessary to resign, e.g., a remote connection has been lost. |
Method | run | No summary |
Method | stop | No summary |
Method | crash | Takes drastic action to shut down the worker, rudely and synchronously. |
Method | _reallyRun | Undocumented |
Inherited from MsgBase:
Method | isVerbose | Undocumented |
Method | verboserator | Undocumented |
Method | msg | Undocumented |
Registers the supplied callableObject to be called if the worker deems it necessary to resign, e.g., a remote connection has been lost.
Adds the task represented by the specified task object to the list of tasks pending for this worker, to be run however and whenever the worker sees fit. However, workers are expected to run highest-priority tasks before anything else they have lined up in their mini-queues.
Unless the worker is constructed with a raw=True
keyword or
the task includes raw=True
, an iterator resulting from the
task is converted into an instance of iteration.Deferator
.
The underlying iteration (possibly across a pipe or wire) must be handled
transparently to the user. If the task has a consumer keyword set to
an implementor of IConsumer
, an iteration.IterationProducer
coupled to that consumer will be the end result instead.
Make sure that any callbacks you add to the task's internal deferred
object task.d
return the callback argument. Otherwise, the
result of your task will be lost in the callback chain.
Returns | A Deferred that fires when the worker is ready to be assigned
another task. |
Attempts to gracefully shut down the worker, returning a
Deferred
that fires when the worker is done with all assigned
tasks and will not cause any errors if the reactor is stopped or its object
is deleted.
The Deferred
returned by your implementation of this method
must not fire until after the results of all pending tasks have been
obtained. Thus the deferred must be chained to each task.d
somehow.
Make sure that any callbacks you add to the task's internal deferred
object task.d
return the callback argument. Otherwise, the
result of your task will be lost in the callback chain.
Takes drastic action to shut down the worker, rudely and synchronously.
Returns | A list of task objects, one for each task left uncompleted. You
shouldn't have to call this method if no tasks are left pending; the stop
method should be enough in that case. |