@@ -279,7 +279,7 @@ def new_receiver(self, *, name: str | None = None, limit: int = 50) -> Receiver[
279279 Returns:
280280 A new receiver attached to this channel.
281281 """
282- recv : _Receiver [_T ] = _Receiver (name , limit , self )
282+ recv : _Receiver [_T ] = _Receiver (self , name = name , limit = limit )
283283 self ._receivers [hash (recv )] = weakref .ref (recv )
284284 if self .resend_latest and self ._latest is not None :
285285 recv .enqueue (self ._latest )
@@ -308,7 +308,7 @@ class _Sender(Sender[_T]):
308308 method.
309309 """
310310
311- def __init__ (self , channel : Broadcast [_T ]) -> None :
311+ def __init__ (self , channel : Broadcast [_T ], / ) -> None :
312312 """Initialize this sender.
313313
314314 Args:
@@ -364,21 +364,23 @@ class _Receiver(Receiver[_T]):
364364 method.
365365 """
366366
367- def __init__ (self , name : str | None , limit : int , channel : Broadcast [_T ]) -> None :
367+ def __init__ (
368+ self , channel : Broadcast [_T ], / , * , name : str | None , limit : int
369+ ) -> None :
368370 """Initialize this receiver.
369371
370372 Broadcast receivers have their own buffer, and when messages are not
371373 being consumed fast enough and the buffer fills up, old messages will
372374 get dropped just in this receiver.
373375
374376 Args:
377+ channel: a reference to the Broadcast channel that this receiver
378+ belongs to.
375379 name: A name to identify the receiver in the logs. If `None` an
376380 `id(self)`-based name will be used. This is only for debugging
377381 purposes, it will be shown in the string representation of the
378382 receiver.
379383 limit: Number of messages the receiver can hold in its buffer.
380- channel: a reference to the Broadcast channel that this receiver
381- belongs to.
382384 """
383385 self ._name : str = name if name is not None else f"{ id (self ):_} "
384386 """The name to identify the receiver.
@@ -392,7 +394,7 @@ def __init__(self, name: str | None, limit: int, channel: Broadcast[_T]) -> None
392394 self ._q : deque [_T ] = deque (maxlen = limit )
393395 """The receiver's internal message queue."""
394396
395- def enqueue (self , message : _T ) -> None :
397+ def enqueue (self , message : _T , / ) -> None :
396398 """Put a message into this receiver's queue.
397399
398400 To be called by broadcast senders. If the receiver's queue is already
0 commit comments