class twisted._threads.IWorker(Interface): (source)
Known subclasses: twisted._threads._ithreads.IExclusiveWorker
A worker that can perform some work concurrently.
All methods on this interface must be thread-safe.
Method | do | Perform the given task. |
Method | quit | Free any resources associated with this IWorker and cause it to reject all future work. |
Perform the given task.
As an interface, this method makes no specific claims about concurrent execution. An IWorker
's do
implementation may defer execution for later on the same thread, immediately on a different thread, or some combination of the two. It is valid for a do
method to schedule task
in such a way that it may never be executed.
It is important for some implementations to provide specific properties with respect to where task
is executed, of course, and client code may rely on a more specific implementation of do
than IWorker
.
Parameters | task | a task to call in a thread or other concurrent context. (type: 0-argument callable) |
Raises | AlreadyQuit | if quit has been called. |