l.s.timeout : module documentation

Part of lp.services

Helpers to time out external operations.
Function get_default_timeout_function Return the function returning the default timeout value to use.
Function set_default_timeout_function Change the function returning the default timeout value to use.
Function default_timeout A context manager that sets the default timeout if none is set.
Function reduced_timeout A context manager that reduces the default timeout.
Function override_timeout A context manager that temporarily overrides the default timeout.
Class TimeoutError Exception raised when a function doesn't complete within time.
Class ThreadCapturingResult Thread subclass that saves the return value of its target.
Class DefaultTimeout Descriptor returning the timeout computed by the default function.
Class with_timeout Make sure the decorated function doesn't exceed a time out.
Class CleanableConnectionPoolMixin Enhance urllib3's connection pools to support forced socket cleanup.
Class CleanableHTTPConnectionPool Undocumented
Class CleanableHTTPSConnectionPool Undocumented
Class CleanablePoolManager A version of urllib3's PoolManager supporting forced socket cleanup.
Class CleanableHTTPAdapter Enhance HTTPAdapter to use CleanablePoolManager.
Function raise_for_status_redacted Like L{requests.models.Response.raise_for_status}, but without the URL.
Class URLFetcher Object fetching remote URLs with a time out.
Function urlfetch Wrapper for requests.get() that times out.
Class TransportWithTimeout Create a HTTP transport for XMLRPC with timeouts.
Class SafeTransportWithTimeout Create a HTTPS transport for XMLRPC with timeouts.
def get_default_timeout_function():
Return the function returning the default timeout value to use.
def set_default_timeout_function(timeout_function):
Change the function returning the default timeout value to use.
@contextmanager
def default_timeout(default):
A context manager that sets the default timeout if none is set.
ParametersdefaultThe default timeout to use if none is set.
@contextmanager
def reduced_timeout(clearance, webapp_max=None, default=None):
A context manager that reduces the default timeout.
ParametersclearanceThe number of seconds by which to reduce the default timeout, to give the call site a chance to recover.
webapp_maxThe maximum permitted time for webapp requests.
defaultThe default timeout to use if none is set.
@contextmanager
def override_timeout(timeout):
A context manager that temporarily overrides the default timeout.
ParameterstimeoutThe new timeout to use.
def raise_for_status_redacted(response):
Like L{requests.models.Response.raise_for_status}, but without the URL.

In some cases, the URL may contain sensitive information such as a password.

def urlfetch(url, **request_kwargs):
Wrapper for requests.get() that times out.
API Documentation for Launchpad, generated by pydoctor at 2019-10-20 00:00:13.