Skip to content

Commit 7ad1cc9

Browse files
committed
Rename BroadcastReceiver.enqueue_enqueue
Now that `BroadcastReceiver` is a public type, its internal methods need to become protected. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
1 parent 98203ae commit 7ad1cc9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/frequenz/channels/_broadcast.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def new_receiver(
313313
)
314314
self._receivers[hash(recv)] = weakref.ref(recv)
315315
if self.resend_latest and self._latest is not None:
316-
recv.enqueue(self._latest)
316+
recv._enqueue(self._latest) # pylint: disable=protected-access
317317
return recv
318318

319319
def __str__(self) -> str:
@@ -392,7 +392,7 @@ async def send(self, message: _T, /) -> None:
392392
if recv is None:
393393
stale_refs.append(_hash)
394394
continue
395-
recv.enqueue(message)
395+
recv._enqueue(message)
396396
for _hash in stale_refs:
397397
del self._channel._receivers[_hash]
398398
async with self._channel._recv_cv:
@@ -500,7 +500,7 @@ def __init__(
500500
self._closed: bool = False
501501
"""Whether the receiver is closed."""
502502

503-
def enqueue(self, message: _T, /) -> None:
503+
def _enqueue(self, message: _T, /) -> None:
504504
"""Put a message into this receiver's queue.
505505
506506
To be called by broadcast senders. If the receiver's queue is already

0 commit comments

Comments
 (0)