asynqueue.threads.ThreadQueue(TaskQueue) class documentation
(View In Hierarchy)
I am a
dispatching arbitrary callables to be run by a single worker thread.
Having one and just one worker thread is surprisingly useful. It lets you do synchronous processing without blocking Twisted's event loop, yet assures you that objects processed during one queued task will not be disturbed until completion of the Deferred callback chain from that task.
Inherited from TaskQueue:
|Returns my "length" as the number of workers currently at my disposal.
|I evaluate as
True if I am running and have at least one
True if shutdown has not been initiated and both my
task handler and queue are running,
|You must call this and wait for the
Deferred it returns
when you're done with me. Calls
among other things.
|Registers a new provider of
IWorker for working on tasks
from the queue.
|Detaches and terminates the worker supplied or specified by its ID.
|Adds the specified series to the qualifications of the supplied worker.
|Returns the worker object specified by ID, or
if that worker is not employed with me.
|Processes the status/result tuple from a worker running a task. You don't need to call this directly.
|Makes a new
tasks.Task object from a
func-args-kw combo. You won't call this directly.
|Queues up a function call.
|Sets an update task from func with any supplied arguments and keywords to be run directly on all current and future workers.
Runs the f-args-kw call in my dedicated worker thread, skipping past the
queue. As with a regular
Deferred that fires with the result and deals with