Skip to content

Commit 2477050

Browse files
committed
Move and improve note in the quick start section
Having the note at the end, just before the Missed ticks and drifting section starts doesn't make a lot of sense, it is better to warn the user before they start reading. Also change from a tip to an important information. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent df1c8ff commit 2477050

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/frequenz/channels/timer.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
66
# Quick Start
77
8+
Info: Important
9+
This quick start is provided to have a quick feeling of how to use this module, but
10+
it is extremely important to understand how timers behave when they are delayed.
11+
12+
We recommend emphatically to read about [missed ticks and
13+
drifting](#missed-ticks-and-drifting) before using timers in production.
14+
815
If you need to do something as periodically as possible (avoiding
916
[drifts](#missed-ticks-and-drifting)), you can use
1017
a [`Timer`][frequenz.channels.timer.Timer] like this:
@@ -67,11 +74,6 @@ async def main() -> None:
6774
if the loop was busy for a few seconds, the timer will trigger immediately and then
6875
wait for another second before triggering again. The missed ticks are skipped.
6976
70-
Tip:
71-
It is extremely important to understand how timers behave when they are
72-
delayed, we recommend emphatically to read about [missed ticks and
73-
drifting](#missed-ticks-and-drifting) before using timers in production.
74-
7577
# Missed Ticks And Drifting
7678
7779
A [`Timer`][frequenz.channels.timer.Timer] can be used to send a messages at regular

0 commit comments

Comments
 (0)