a.i.Delay(object) : class documentation

Part of asynqueue.iteration View In Hierarchy Source for iteration.py Project Page for AsynQueue

I let you delay things and wait for things that may take a while, in Twisted fashion.

Perhaps a bit more suited to the util module, but that would require this module to import it, and it imports this module.

With event delays of 100 ms to 1 second (in process.ProcessWorker, setting backoff to 1.10 seems more efficient than 1.05 or 1.20, with the (initial) interval of 50 ms. However, you may want to tune things for your application and system.

Instance Variable interval The initial event-checking interval, in seconds. (type: float)
Instance Variable backoff The backoff exponent. (type: float)
Method __init__ Undocumented
Method __call__ No summary
Method untilEvent No summary
interval =
The initial event-checking interval, in seconds. (type: float)
backoff =
The backoff exponent. (type: float)
def __init__(self, interval=None, backoff=None, timeout=None):
def __call__(self, delay=None):

Returns a Deferred that fires after my default delay interval or one you specify. You can have it fire in the next reactor iteration by setting delay to zero (not None, as that will use the default delay instead).

The default interval is 10ms unless you override that in by setting my interval attribute to something else.

def untilEvent(self, eventChecker, *args, **kw):

Returns a Deferred that fires when a call to the supplied event-checking callable returns an affirmative (not None, False, etc.) result, or until the optional timeout limit is reached. The result of the Deferred is True if the event actually happened, or False if a timeout occurred.

The event checker should not return a Deferred. I call the event checker less and less frequently as the wait goes on, depending on the backoff exponent (default is 1.04).

ParameterseventCheckerA no-argument callable that returns an immediate boolean value indicating if an event occurred.
API Documentation for AsynQueue, generated by pydoctor at 2018-08-29 10:51:11.