From 7c6f6571f1230692c186d619ae5a7fa363a22993 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 4 Oct 2021 11:22:10 -0400 Subject: [PATCH] Move broadcast channel parts into trionics --- tests/test_task_broadcasting.py | 3 +-- tractor/_streaming.py | 2 +- tractor/trionics/__init__.py | 3 +++ tractor/{ => trionics}/_broadcast.py | 0 4 files changed, 5 insertions(+), 3 deletions(-) rename tractor/{ => trionics}/_broadcast.py (100%) diff --git a/tests/test_task_broadcasting.py b/tests/test_task_broadcasting.py index f32d209..b18a40e 100644 --- a/tests/test_task_broadcasting.py +++ b/tests/test_task_broadcasting.py @@ -12,7 +12,7 @@ import pytest import trio from trio.lowlevel import current_task import tractor -from tractor._broadcast import broadcast_receiver, Lagged +from tractor.trionics import broadcast_receiver, Lagged @tractor.context @@ -432,7 +432,6 @@ def test_first_recver_is_cancelled(): tx, rx = trio.open_memory_channel(1) brx = broadcast_receiver(rx, 1) cs = trio.CancelScope() - sequence = list(range(3)) async def sub_and_recv(): with cs: diff --git a/tractor/_streaming.py b/tractor/_streaming.py index 6ee264c..5c22116 100644 --- a/tractor/_streaming.py +++ b/tractor/_streaming.py @@ -19,8 +19,8 @@ import trio from ._ipc import Channel from ._exceptions import unpack_error, ContextCancelled from ._state import current_actor -from ._broadcast import broadcast_receiver, BroadcastReceiver from .log import get_logger +from .trionics import broadcast_receiver, BroadcastReceiver log = get_logger(__name__) diff --git a/tractor/trionics/__init__.py b/tractor/trionics/__init__.py index 620d25a..a5b2c87 100644 --- a/tractor/trionics/__init__.py +++ b/tractor/trionics/__init__.py @@ -3,8 +3,11 @@ Sugary patterns for trio + tractor designs. ''' from ._mngrs import async_enter_all +from ._broadcast import broadcast_receiver, BroadcastReceiver __all__ = [ 'async_enter_all', + 'broadcast_receiver', + 'BroadcastReceiver', ] diff --git a/tractor/_broadcast.py b/tractor/trionics/_broadcast.py similarity index 100% rename from tractor/_broadcast.py rename to tractor/trionics/_broadcast.py