File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class Merge(Receiver[T]):
1717 can be awaited together, and their results merged into a single stream, by
1818 using `Merge` like this:
1919
20- ```
20+ ```python
2121 merge = Merge(receiver1, receiver2)
2222 while msg := await merge.receive():
2323 # do something with msg
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class Select:
3434 For example, if there are two async iterators that you want to
3535 simultaneously wait on, this can be done with:
3636
37- ```
37+ ```python
3838 select = Select(name1 = receiver1, name2 = receiver2)
3939 while await select.ready():
4040 if msg := select.name1:
@@ -50,8 +50,9 @@ class Select:
5050 ```
5151
5252 If `Select` was created with more `AsyncIterator` than what are read in
53- the if-chain after each call to `ready()`, messages coming in the
54- additional async iterators are dropped, and a warning message is logged.
53+ the if-chain after each call to [ready()][frequenz.channels.Select.ready],
54+ messages coming in the additional async iterators are dropped, and
55+ a warning message is logged.
5556
5657 `Receivers` also function as AsyncIterator.
5758 """
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class Timer(Receiver[datetime]):
1616 Primarily for use with `channel.Select` calls.
1717
1818 When you want something to happen with a fixed period:
19- ```
19+ ```python
2020 timer = channel.Timer(30.0)
2121 select = Select(bat_1 = receiver1, timer = timer)
2222 while await select.ready():
@@ -32,7 +32,7 @@ class Timer(Receiver[datetime]):
3232
3333 When you want something to happen when nothing else has happened in a
3434 certain interval:
35- ```
35+ ```python
3636 timer = channel.Timer(30.0)
3737 select = Select(bat_1 = receiver1, timer = timer)
3838 while await select.ready():
You can’t perform that action at this time.
0 commit comments