From c9234fbd9ccc78c4fbe4c51408237c42ad39bf8f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 5 Mar 2025 09:54:56 -0500 Subject: [PATCH] Comment-tag pause points in `asycnio_bp.py` Thought i already did this but, obvi needed these to make the expect matches pass in our test. --- examples/debugging/asyncio_bp.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/debugging/asyncio_bp.py b/examples/debugging/asyncio_bp.py index b55b28f..296dbcc 100644 --- a/examples/debugging/asyncio_bp.py +++ b/examples/debugging/asyncio_bp.py @@ -25,7 +25,7 @@ async def bp_then_error( ) -> None: - # sync with ``trio``-side (caller) task + # sync with `trio`-side (caller) task to_trio.send_nowait('start') # NOTE: what happens here inside the hook needs some refinement.. @@ -33,8 +33,7 @@ async def bp_then_error( # we set `Lock.local_task_in_debug = 'sync'`, we probably want # some further, at least, meta-data about the task/actor in debug # in terms of making it clear it's `asyncio` mucking about. - breakpoint() - + breakpoint() # asyncio-side # short checkpoint / delay await asyncio.sleep(0.5) # asyncio-side @@ -58,7 +57,6 @@ async def trio_ctx( # this will block until the ``asyncio`` task sends a "first" # message, see first line in above func. async with ( - to_asyncio.open_channel_from( bp_then_error, # raise_after_bp=not bp_before_started, @@ -69,7 +67,7 @@ async def trio_ctx( assert first == 'start' if bp_before_started: - await tractor.pause() + await tractor.pause() # trio-side await ctx.started(first) # trio-side @@ -111,7 +109,7 @@ async def main( # pause in parent to ensure no cross-actor # locking problems exist! - await tractor.pause() + await tractor.pause() # trio-root if cancel_from_root: await ctx.cancel()