@@ -184,7 +184,7 @@ async def main() -> None:
184184 """
185185
186186 def __init__ (self , * , name : str , resend_latest : bool = False ) -> None :
187- """Create a Broadcast channel.
187+ """Initialize this channel.
188188
189189 Args:
190190 name: The name of the channel. This is for logging purposes, and it will be
@@ -246,7 +246,7 @@ def is_closed(self) -> bool:
246246 return self ._closed
247247
248248 async def close (self ) -> None :
249- """Close the Broadcast channel.
249+ """Close this channel.
250250
251251 Any further attempts to [send()][frequenz.channels.Sender.send] data
252252 will return `False`.
@@ -262,15 +262,11 @@ async def close(self) -> None:
262262 self ._recv_cv .notify_all ()
263263
264264 def new_sender (self ) -> Sender [_T ]:
265- """Create a new broadcast sender.
266-
267- Returns:
268- A Sender instance attached to the broadcast channel.
269- """
265+ """Return a new sender attached to this channel."""
270266 return _Sender (self )
271267
272268 def new_receiver (self , * , name : str | None = None , limit : int = 50 ) -> Receiver [_T ]:
273- """Create a new broadcast receiver.
269+ """Return a new receiver attached to this channel .
274270
275271 Broadcast receivers have their own buffer, and when messages are not
276272 being consumed fast enough and the buffer fills up, old messages will
@@ -281,7 +277,7 @@ def new_receiver(self, *, name: str | None = None, limit: int = 50) -> Receiver[
281277 limit: Number of messages the receiver can hold in its buffer.
282278
283279 Returns:
284- A Receiver instance attached to the broadcast channel.
280+ A new receiver attached to this channel.
285281 """
286282 recv : _Receiver [_T ] = _Receiver (name , limit , self )
287283 self ._receivers [hash (recv )] = weakref .ref (recv )
@@ -290,7 +286,7 @@ def new_receiver(self, *, name: str | None = None, limit: int = 50) -> Receiver[
290286 return recv
291287
292288 def __str__ (self ) -> str :
293- """Return a string representation of this receiver ."""
289+ """Return a string representation of this channel ."""
294290 return f"{ type (self ).__name__ } :{ self ._name } "
295291
296292 def __repr__ (self ) -> str :
@@ -313,7 +309,7 @@ class _Sender(Sender[_T]):
313309 """
314310
315311 def __init__ (self , chan : Broadcast [_T ]) -> None :
316- """Create a Broadcast sender.
312+ """Initialize this sender.
317313
318314 Args:
319315 chan: A reference to the broadcast channel this sender belongs to.
@@ -328,7 +324,7 @@ async def send(self, msg: _T) -> None:
328324 msg: The message to be broadcast.
329325
330326 Raises:
331- SenderError: if the underlying channel was closed.
327+ SenderError: If the underlying channel was closed.
332328 A [ChannelClosedError][frequenz.channels.ChannelClosedError] is
333329 set as the cause.
334330 """
@@ -369,7 +365,7 @@ class _Receiver(Receiver[_T]):
369365 """
370366
371367 def __init__ (self , name : str | None , limit : int , chan : Broadcast [_T ]) -> None :
372- """Create a broadcast receiver.
368+ """Initialize this receiver.
373369
374370 Broadcast receivers have their own buffer, and when messages are not
375371 being consumed fast enough and the buffer fills up, old messages will
@@ -457,7 +453,7 @@ def consume(self) -> _T:
457453 The next value that was received.
458454
459455 Raises:
460- ReceiverStoppedError: if there is some problem with the receiver.
456+ ReceiverStoppedError: If there is some problem with the receiver.
461457 """
462458 if not self ._q and self ._chan ._closed : # pylint: disable=protected-access
463459 raise ReceiverStoppedError (self ) from ChannelClosedError (self ._chan )
0 commit comments