Skip to content

Commit f0801b9

Browse files
committed
Broadcast: Move the resend_latest attribute to the end
This is so it is closer to the other public attributes (properties) of the class. Also remove the mention to the default, as the default belongs to the `__init__` argument docs. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent b2ea4fa commit f0801b9

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/frequenz/channels/_broadcast.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,6 @@ def __init__(self, *, name: str | None, resend_latest: bool = False) -> None:
9191
Only used for debugging purposes.
9292
"""
9393

94-
self.resend_latest: bool = resend_latest
95-
"""Whether to resend the latest value to new receivers.
96-
97-
It is `False` by default.
98-
99-
When `True`, every time a new receiver is created with `new_receiver`, it will
100-
automatically get sent the latest value on the channel. This allows new
101-
receivers on slow streams to get the latest value as soon as they are created,
102-
without having to wait for the next message on the channel to arrive.
103-
104-
It is safe to be set in data/reporting channels, but is not recommended for use
105-
in channels that stream control instructions.
106-
"""
107-
10894
self._recv_cv: Condition = Condition()
10995
"""The condition to wait for data in the channel's buffer."""
11096

@@ -117,6 +103,18 @@ def __init__(self, *, name: str | None, resend_latest: bool = False) -> None:
117103
self._latest: T | None = None
118104
"""The latest value sent to the channel."""
119105

106+
self.resend_latest: bool = resend_latest
107+
"""Whether to resend the latest value to new receivers.
108+
109+
When `True`, every time a new receiver is created with `new_receiver`, it will
110+
automatically get sent the latest value on the channel. This allows new
111+
receivers on slow streams to get the latest value as soon as they are created,
112+
without having to wait for the next message on the channel to arrive.
113+
114+
It is safe to be set in data/reporting channels, but is not recommended for use
115+
in channels that stream control instructions.
116+
"""
117+
120118
@property
121119
def name(self) -> str:
122120
"""The name of this channel.

0 commit comments

Comments
 (0)