Skip to content

Commit

Permalink
Add back in async gen loop
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Feb 16, 2022
1 parent 8d77fa9 commit 534277d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions examples/debugging/subactor_bp_in_ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ async def gen():
yield 'yo'
await tractor.breakpoint()
yield 'yo'
await tractor.breakpoint()


@tractor.context
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``:
Expand All @@ -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()


Expand Down

0 comments on commit 534277d

Please sign in to comment.