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`.`internet`.`base`.`ThreadedResolver``

class documentation

`class ThreadedResolver: (source)`

Known subclasses: `twisted.names.client.ThreadedResolver`

Implements interfaces: `twisted.internet.interfaces.IResolverSimple`

View In Hierarchy

`ThreadedResolver` uses a reactor, a threadpool, and `socket.gethostbyname` to perform name lookups without blocking the reactor thread. It also supports timeouts indepedently from whatever timeout logic `socket.gethostbyname` might have.

Method | `__init__` | Undocumented
Method | `getHostByName` | See `twisted.internet.interfaces.IResolverSimple.getHostByName`.
Instance Variable | `reactor` | The reactor the threadpool of which will be used to call `socket.gethostbyname` and the I/O thread of which the result will be delivered.
Method | `_checkTimeout` | Undocumented
Method | `_cleanup` | Undocumented
Method | `_fail` | Undocumented
Instance Variable | `_runningQueries` | Undocumented

def __init__(self, reactor): (source)
overridden in `twisted.names.client.ThreadedResolver`

Undocumented

Parameters
reactor:`ReactorBase` | Undocumented

def getHostByName(self, name, timeout=(1, 3, 11, 45)): (source)
from `twisted.internet.interfaces.IResolverSimple`

See `twisted.internet.interfaces.IResolverSimple.getHostByName`.

Note that the elements of `timeout` are summed and the result is used as a timeout for the lookup. Any intermediate timeout or retry logic is left up to the platform via `socket.gethostbyname`.

Parameters
name:`str` | Undocumented
timeout:`Sequence[int]` | Undocumented
Returns
`Deferred[str]` | Undocumented

reactor = (source)

The reactor the threadpool of which will be used to call `socket.gethostbyname` and the I/O thread of which the result will be delivered.

def _checkTimeout(self, result, name, lookupDeferred): (source)

Undocumented

Parameters
result:`str` | Undocumented
name:`str` | Undocumented
lookupDeferred:`Deferred[str]` | Undocumented

def _cleanup(self, name, lookupDeferred): (source)

Undocumented

Parameters
name:`str` | Undocumented
lookupDeferred:`Deferred[str]` | Undocumented

def _fail(self, name, err): (source)

Undocumented

Parameters
name:`str` | Undocumented
err:`str` | Undocumented
Returns
`Failure` | Undocumented

_runningQueries: `Dict[Deferred[str], Tuple[Deferred[str], IDelayedCall]]` = (source)

Undocumented