From 64358f6525e75d1035730422ade681895afff7fd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 9 Aug 2021 07:35:42 -0400 Subject: [PATCH] Rename to broadcast mod, don't expect mem chan specifically --- tractor/{_live_from_tokio.py => _broadcast.py} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename tractor/{_live_from_tokio.py => _broadcast.py} (97%) diff --git a/tractor/_live_from_tokio.py b/tractor/_broadcast.py similarity index 97% rename from tractor/_live_from_tokio.py rename to tractor/_broadcast.py index 16f6aaf..3834116 100644 --- a/tractor/_live_from_tokio.py +++ b/tractor/_broadcast.py @@ -15,9 +15,9 @@ import tractor from trio.lowlevel import current_task from trio.abc import ReceiveChannel from trio._core._run import Task -from trio._channel import ( - MemoryReceiveChannel, -) +# from trio._channel import ( +# MemoryReceiveChannel, +# ) class Lagged(trio.TooSlowError): @@ -43,7 +43,7 @@ class BroadcastReceiver(ReceiveChannel): self._rx = rx_chan self._queue = queue self._subs: dict[Task, int] = {} # {id(current_task()): -1} - self._clones: dict[Task, MemoryReceiveChannel] = {} + self._clones: dict[Task, ReceiveChannel] = {} self._value_received: Optional[trio.Event] = None async def receive(self): @@ -138,7 +138,7 @@ class BroadcastReceiver(ReceiveChannel): def broadcast_receiver( - recv_chan: MemoryReceiveChannel, + recv_chan: ReceiveChannel, max_buffer_size: int, ) -> BroadcastReceiver: