A Repeater can call a RepeatingWork function repeatedly.
| Class Method | new |
Create a Repeater, filling out its reference time with the current time of the given scheduler, if no other time is provided. |
| Method | repeat |
Repeat the work associated with this Repeater. |
| Instance Variable | convert |
Since a Scheduler requires that any work provided be specifically of its WhatT type, which may need to have some property associated with it beyond its function signature (for example, additional attributes for instrumentation or serialization), so this ... |
| Instance Variable | reference |
The current reference time, i.e. the time at which the next invocation of work should occur. |
| Instance Variable | rule |
The RecurrenceRule that defines the times at which work will be invoked. |
| Instance Variable | scheduler |
The scheduler where the work will be performed. |
| Instance Variable | work |
The RepeatingWork that will be performed. |
def new(cls, scheduler:
Scheduler[ WhenT, WhatT, object], rule: RecurrenceRule[ WhenT, StepsT], work: RepeatingWork[ StepsT], convert: Callable[ [ Repeater[ WhenT, WhatT, StepsT]], WhatT], reference: WhenT | None = None) -> Repeater[ WhenT, WhatT, StepsT]:
(source)
¶
Create a Repeater, filling out its reference time with the current time of the given scheduler, if no other time is provided.
Repeat the work associated with this Repeater.
Applications should call this once, and only once, after the Repeater is created, in order to kick off the repetition. All future calls should be performed via the result of convert being called in the scheduler, or the timing of repeated invocations will be incorrect.
Since a Scheduler requires that any work provided be specifically of its WhatT type, which may need to have some property associated with it beyond its function signature (for example, additional attributes for instrumentation or serialization), so this convert function will convert this Repeater into a 0-argument function that both: