forked from goodboy/tractor
1
0
Fork 0

Drop shielded stream api usage

live_on_air_from_tokio
Tyler Goodlet 2021-09-01 10:38:31 -04:00
parent d9bb52fe7b
commit b7b489dd07
1 changed files with 1 additions and 10 deletions

View File

@ -64,7 +64,6 @@ async def open_sequence_streamer(
sequence: List[int], sequence: List[int],
arb_addr: Tuple[str, int], arb_addr: Tuple[str, int],
start_method: str, start_method: str,
shield: bool = False,
) -> tractor.MsgStream: ) -> tractor.MsgStream:
@ -83,7 +82,7 @@ async def open_sequence_streamer(
) as (ctx, first): ) as (ctx, first):
assert first is None assert first is None
async with ctx.open_stream(shield=shield) as stream: async with ctx.open_stream() as stream:
yield stream yield stream
await portal.cancel_actor() await portal.cancel_actor()
@ -224,16 +223,8 @@ def test_faster_task_to_recv_is_cancelled_by_slower(
arb_addr, arb_addr,
start_method, start_method,
# NOTE: this MUST be set to avoid the stream terminating
# early when the faster subtask is cancelled by the slower
# parent task.
shield=True,
) as stream: ) as stream:
# alt to passing kwarg above.
# with stream.shield():
async with trio.open_nursery() as n: async with trio.open_nursery() as n:
n.start_soon( n.start_soon(
ensure_sequence, ensure_sequence,