@@ -270,36 +270,49 @@ def __repr__(self) -> str:
270270class Timer (Receiver [timedelta ]):
271271 """A timer receiver that triggers every `interval` time.
272272
273- The timer as microseconds resolution, so the `interval` must be at least
273+ The timer has microseconds resolution, so the
274+ [`interval`][frequenz.channels.util.Timer.interval] must be at least
274275 1 microsecond.
275276
276- The message it produces is a `timedelta` containing the drift of the timer,
277- i.e. the difference between when the timer should have triggered and the time
278- when it actually triggered.
277+ The message it produces is a [ `timedelta`][datetime.timedelta] containing the drift
278+ of the timer, i.e. the difference between when the timer should have triggered and
279+ the time when it actually triggered.
279280
280281 This drift will likely never be `0`, because if there is a task that is
281282 running when it should trigger, the timer will be delayed. In this case the
282283 drift will be positive. A negative drift should be technically impossible,
283- as the timer uses `asyncio`s loop monotonic clock.
284+ as the timer uses [ `asyncio`][asyncio] s loop monotonic clock.
284285
285- If the timer is delayed too much, then the timer will behave according to
286- the `missed_tick_policy`. Missing ticks might or might not trigger
287- a message and the drift could be accumulated or not depending on the
288- chosen policy.
286+ If the timer is delayed too much, then it will behave according to the
287+ [ `missed_tick_policy`][frequenz.channels.util.Timer.missed_tick_policy]. Missing
288+ ticks might or might not trigger a message and the drift could be accumulated or not
289+ depending on the chosen policy.
289290
290- The timer accepts an optional `loop`, which will be used to track the time.
291- If `loop` is `None`, then the running loop will be used (if there is no
292- running loop most calls will raise a `RuntimeError`).
291+ These are the currently built-in available policies:
293292
294- Starting the timer can be delayed if necessary by using `auto_start=False`
295- (for example until we have a running loop). A call to `reset()`, `ready()`,
296- `receive()` or the async iterator interface to await for a new message will
297- start the timer.
293+ * [`SkipMissedAndDrift`][frequenz.channels.util.SkipMissedAndDrift]
294+ * [`SkipMissedAndResync`][frequenz.channels.util.SkipMissedAndResync]
295+ * [`TriggerAllMissed`][frequenz.channels.util.TriggerAllMissed]
298296
299297 For the most common cases, a specialized constructor is provided:
300298
301- * [`periodic()`][frequenz.channels.util.Timer.periodic]
302- * [`timeout()`][frequenz.channels.util.Timer.timeout]
299+ * [`periodic()`][frequenz.channels.util.Timer.periodic] (uses the
300+ [`TriggerAllMissed`][frequenz.channels.util.TriggerAllMissed] or
301+ [`SkipMissedAndResync`][frequenz.channels.util.SkipMissedAndResync] policy)
302+ * [`timeout()`][frequenz.channels.util.Timer.timeout] (uses the
303+ [`SkipMissedAndDrift`][frequenz.channels.util.SkipMissedAndDrift] policy)
304+
305+ The timer accepts an optional [`loop`][frequenz.channels.util.Timer.loop], which
306+ will be used to track the time. If `loop` is `None`, then the running loop will be
307+ used (if there is no running loop most calls will raise
308+ a [`RuntimeError`][RuntimeError]).
309+
310+ Starting the timer can be delayed if necessary by using `auto_start=False`
311+ (for example until we have a running loop). A call to
312+ [`reset()`][frequenz.channels.util.Timer.reset],
313+ [`ready()`][frequenz.channels.util.Timer.ready],
314+ [`receive()`][frequenz.channels.util.Timer.receive] or the async iterator interface
315+ to await for a new message will start the timer.
303316
304317 Example: Periodic timer example
305318 ```python
0 commit comments