twisted.internet.defer.Deferred.addTimeout(self, timeout, clock, onTimeoutCancel=None)
method documentationtwisted.internet.defer.Deferred
View Source
Time out this Deferred
by
scheduling it to be cancelled after timeout
seconds.
The timeout encompasses all the callbacks and errbacks added to this defer.Deferred
before the call to addTimeout
,
and none added after the call.
If this Deferred
gets
timed out, it errbacks with a TimeoutError
,
unless a cancelable function was passed to its initialization or unless a
different onTimeoutCancel
callable is provided.
Parameters | timeout | number of seconds to wait before timing out this Deferred (type: int ) |
clock | The object which will be used to schedule the timeout. (type: twisted.internet.interfaces.IReactorTime ) | |
onTimeoutCancel | A callable which is called immediately after this Deferred times
out, and not if this Deferred is
otherwise cancelled before the timeout. It takes an arbitrary value, which
is the value of this Deferred at
that exact point in time (probably a CancelledError
Failure ),
and the timeout . The default callable (if none is provided)
will translate a CancelledError
Failure into
a TimeoutError . (type: callable ) | |
Returns | self . (type: a Deferred ) | |
Present Since | 16.5 |