Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`_threads`.`IWorker``

interface documentation

`class IWorker(Interface): (source)`

Known subclasses: `twisted._threads._ithreads.IExclusiveWorker`

Known implementations: `twisted._threads._memory.MemoryWorker`, `twisted._threads.Team`

View In Hierarchy

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.

def do(task): (source)

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:0-argument callable | a task to call in a thread or other concurrent context.
Raises
`AlreadyQuit` | if `quit` has been called.

def quit(): (source)

Free any resources associated with this `IWorker` and cause it to reject all future work.

Raises
`AlreadyQuit` | if this method has already been called.