@@ -25,8 +25,8 @@ class Broadcast(Generic[T]):
2525 receivers.
2626
2727 Internally, a broadcast receiver's buffer is implemented with just
28- append/pop operations on either side of a ` collections.deque` , which are
29- thread-safe. Because of this, `Broadcast` channels are thread-safe.
28+ append/pop operations on either side of a [deque][ collections.deque] , which
29+ are thread-safe. Because of this, `Broadcast` channels are thread-safe.
3030
3131 Example:
3232 ``` python
@@ -83,10 +83,13 @@ def __init__(self, name: str, resend_latest: bool = False) -> None:
8383 async def close (self ) -> None :
8484 """Close the Broadcast channel.
8585
86- Any further attempts to `send` data will return False.
86+ Any further attempts to [send()][frequenz.channels.Sender.send] data
87+ will return `False`.
8788
8889 Receivers will still be able to drain the pending items on their queues,
89- but after that, subsequent `recv` calls will return None immediately.
90+ but after that, subsequent
91+ [receive()][frequenz.channels.Receiver.receive] calls will return `None`
92+ immediately.
9093 """
9194 self ._latest = None
9295 self .closed = True
@@ -140,8 +143,9 @@ def get_receiver(
140143 def get_peekable (self ) -> "Peekable[T]" :
141144 """Create a new Peekable for the broadcast channel.
142145
143- A Peekable provides a `peek` method that allows the user to get a peek
144- at the latest value in the channel, without consuming anything.
146+ A Peekable provides a [peek()][frequenz.channels.Peekable.peek] method
147+ that allows the user to get a peek at the latest value in the channel,
148+ without consuming anything.
145149
146150 Returns:
147151 A Peekable to peek into the broadcast channel with.
@@ -152,7 +156,8 @@ def get_peekable(self) -> "Peekable[T]":
152156class Sender (BaseSender [T ]):
153157 """A sender to send messages to the broadcast channel.
154158
155- Should not be created directly, but through the `Channel.get_sender()`
159+ Should not be created directly, but through the
160+ [Broadcast.get_sender()][frequenz.channels.Broadcast.get_sender]
156161 method.
157162 """
158163
@@ -188,7 +193,8 @@ async def send(self, msg: T) -> bool:
188193class Receiver (BufferedReceiver [T ]):
189194 """A receiver to receive messages from the broadcast channel.
190195
191- Should not be created directly, but through the `Channel.get_receiver()`
196+ Should not be created directly, but through the
197+ [Broadcast.get_receiver()][frequenz.channels.Broadcast.get_receiver]
192198 method.
193199 """
194200
@@ -253,8 +259,9 @@ async def receive(self) -> Optional[T]:
253259 them. If there are no remaining messages in the buffer and the channel
254260 is closed, returns `None` immediately.
255261
256- If `into_peekable` is called on a broadcast `Receiver`, further calls to
257- `receive`, will raise an `EOFError`.
262+ If [into_peekable()][frequenz.channels.Receiver.into_peekable] is called
263+ on a broadcast `Receiver`, further calls to `receive`, will raise an
264+ `EOFError`.
258265
259266 Raises:
260267 EOFError: when the receiver has been converted into a `Peekable`.
@@ -277,7 +284,8 @@ def into_peekable(self) -> "Peekable[T]":
277284 """Convert the `Receiver` implementation into a `Peekable`.
278285
279286 Once this function has been called, the receiver will no longer be
280- usable, and calling `receive` on the receiver will raise an exception.
287+ usable, and calling [receive()][frequenz.channels.Receiver.receive] on
288+ the receiver will raise an exception.
281289
282290 Returns:
283291 A `Peekable` instance.
@@ -290,8 +298,9 @@ def into_peekable(self) -> "Peekable[T]":
290298class Peekable (BasePeekable [T ]):
291299 """A Peekable to peek into broadcast channels.
292300
293- A Peekable provides a `peek` method that allows the user to get a peek at
294- the latest value in the channel, without consuming anything.
301+ A Peekable provides a [peek()][frequenz.channels.Peekable] method that
302+ allows the user to get a peek at the latest value in the channel, without
303+ consuming anything.
295304 """
296305
297306 def __init__ (self , chan : Broadcast [T ]) -> None :
0 commit comments