withCount(cls,
countCallable)
Class Method
|
|
An alternate constructor for LoopingCall
that makes available the number of calls which should have occurred since
it was last invoked.
Note that this number is an int value; It represents the
discrete number of calls that should have been made. For example, if you
are using a looping call to display an animation with discrete frames,
this number would be the number of frames to advance.
The count is normally 1, but can be higher. For example, if the
reactor is blocked and takes too long to invoke the LoopingCall , a Deferred returned from a previous call
is not fired before an interval has elapsed, or if the callable itself
blocks for longer than an interval, preventing itself from being
called.
- Parameters:
countCallable (1-argument callable which takes an int ) - A callable that will be invoked each time the resulting
LoopingCall is run, with an integer specifying the number of
calls that should have been invoked.
- Returns:
LoopingCall
- An instance of
LoopingCall with call
counting enabled, which provides the count as the first
positional argument.
|