From dd23e78de144f6c28ec2cb3f68e944fe00e30e4f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 16 Feb 2022 13:59:23 -0500 Subject: [PATCH] Add back in async gen loop --- examples/debugging/subactor_bp_in_ctx.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/debugging/subactor_bp_in_ctx.py b/examples/debugging/subactor_bp_in_ctx.py index 268b1d6..a47dbd9 100644 --- a/examples/debugging/subactor_bp_in_ctx.py +++ b/examples/debugging/subactor_bp_in_ctx.py @@ -6,6 +6,7 @@ async def gen(): yield 'yo' await tractor.breakpoint() yield 'yo' + await tractor.breakpoint() @tractor.context @@ -13,14 +14,17 @@ async def just_bp( ctx: tractor.Context, ) -> None: - await ctx.started('yo bpin here') + await ctx.started() await tractor.breakpoint() # TODO: bps and errors in this call.. - # async for val in gen(): - # print(val) + async for val in gen(): + print(val) - await trio.sleep(0.5) + # await trio.sleep(0.5) + + # prematurely destroy the connection + await ctx.chan.aclose() # THIS CAUSES AN UNRECOVERABLE HANG # without latest ``pdbpp``: @@ -30,20 +34,15 @@ async def just_bp( async def main(): async with tractor.open_nursery( - # loglevel='transport', debug_mode=True, ) as n: p = await n.start_actor( 'bp_boi', enable_modules=[__name__], - # debug_mode=True, ) async with p.open_context( just_bp, ) as (ctx, first): - - # await tractor.breakpoint() - # breakpoint() await trio.sleep_forever()