class documentation

class twisted.internet.base.ThreadedResolver: (source)

Known subclasses: twisted.names.client.ThreadedResolver

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.

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 __init__ Undocumented
Method getHostByName See twisted.internet.interfaces.IResolverSimple.getHostByName.
Instance Variable _runningQueries Undocumented
Method _fail Undocumented
Method _cleanup Undocumented
Method _checkTimeout 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 __init__(self, reactor): (source)

Undocumented

ParametersreactorUndocumented (type: ReactorBase)
_runningQueries = (source)

Undocumented

(type: Dict[Deferred, Tuple[Deferred, IDelayedCall]])
def _fail(self, name, err): (source)

Undocumented

ParametersnameUndocumented (type: str)
errUndocumented (type: str)
ReturnsUndocumented (type: Failure)
def _cleanup(self, name, lookupDeferred): (source)

Undocumented

ParametersnameUndocumented (type: str)
lookupDeferredUndocumented (type: Deferred)
def _checkTimeout(self, result, name, lookupDeferred): (source)

Undocumented

ParametersresultUndocumented (type: object)
nameUndocumented (type: str)
lookupDeferredUndocumented (type: Deferred)
def getHostByName(self, name, timeout=(1, 3, 11, 45)): (source)

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.

ParametersnameUndocumented (type: str)
timeoutUndocumented (type: Sequence[int])
ReturnsUndocumented (type: Deferred)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.