Move broadcast channel parts into trionics

patch-async-enter-all
Tyler Goodlet 2021-10-04 11:22:10 -04:00
parent 917d94dcbb
commit c2a19c630b
4 changed files with 5 additions and 3 deletions

View File

@ -12,7 +12,7 @@ import pytest
import trio import trio
from trio.lowlevel import current_task from trio.lowlevel import current_task
import tractor import tractor
from tractor._broadcast import broadcast_receiver, Lagged from tractor.trionics import broadcast_receiver, Lagged
@tractor.context @tractor.context
@ -432,7 +432,6 @@ def test_first_recver_is_cancelled():
tx, rx = trio.open_memory_channel(1) tx, rx = trio.open_memory_channel(1)
brx = broadcast_receiver(rx, 1) brx = broadcast_receiver(rx, 1)
cs = trio.CancelScope() cs = trio.CancelScope()
sequence = list(range(3))
async def sub_and_recv(): async def sub_and_recv():
with cs: with cs:

View File

@ -19,8 +19,8 @@ import trio
from ._ipc import Channel from ._ipc import Channel
from ._exceptions import unpack_error, ContextCancelled from ._exceptions import unpack_error, ContextCancelled
from ._state import current_actor from ._state import current_actor
from ._broadcast import broadcast_receiver, BroadcastReceiver
from .log import get_logger from .log import get_logger
from .trionics import broadcast_receiver, BroadcastReceiver
log = get_logger(__name__) log = get_logger(__name__)

View File

@ -3,8 +3,11 @@ Sugary patterns for trio + tractor designs.
''' '''
from ._mngrs import async_enter_all from ._mngrs import async_enter_all
from ._broadcast import broadcast_receiver, BroadcastReceiver
__all__ = [ __all__ = [
'async_enter_all', 'async_enter_all',
'broadcast_receiver',
'BroadcastReceiver',
] ]