We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 67dbfa1 + 6b4c22c commit 25ddc18Copy full SHA for 25ddc18
src/frequenz/channels/_broadcast.py
@@ -270,6 +270,12 @@ async def ready(self) -> None:
270
async with self._chan.recv_cv:
271
await self._chan.recv_cv.wait()
272
273
+ def _deactivate(self) -> None:
274
+ """Set the receiver as inactive and remove it from the channel."""
275
+ self._active = False
276
+ if self._uuid in self._chan.receivers:
277
+ del self._chan.receivers[self._uuid]
278
+
279
def consume(self) -> T:
280
"""Return the latest value once `ready` is complete.
281
@@ -290,7 +296,7 @@ def into_peekable(self) -> Peekable[T]:
290
296
Returns:
291
297
A `Peekable` instance.
292
298
"""
293
- self._active = False
299
+ self._deactivate()
294
300
return Peekable(self._chan)
295
301
302
0 commit comments