Skip to content

Commit a41fa3c

Browse files
committed
Add back in async gen loop
1 parent c55fa12 commit a41fa3c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

examples/debugging/subactor_bp_in_ctx.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ async def gen():
66
yield 'yo'
77
await tractor.breakpoint()
88
yield 'yo'
9+
await tractor.breakpoint()
910

1011

1112
@tractor.context
1213
async def just_bp(
1314
ctx: tractor.Context,
1415
) -> None:
1516

16-
await ctx.started('yo bpin here')
17+
await ctx.started()
1718
await tractor.breakpoint()
1819

1920
# TODO: bps and errors in this call..
20-
# async for val in gen():
21-
# print(val)
21+
async for val in gen():
22+
print(val)
23+
24+
# await trio.sleep(0.5)
2225

23-
await trio.sleep(0.5)
26+
# prematurely destroy the connection
27+
await ctx.chan.aclose()
2428

2529
# THIS CAUSES AN UNRECOVERABLE HANG
2630
# without latest ``pdbpp``:
@@ -30,20 +34,15 @@ async def just_bp(
3034

3135
async def main():
3236
async with tractor.open_nursery(
33-
# loglevel='transport',
3437
debug_mode=True,
3538
) as n:
3639
p = await n.start_actor(
3740
'bp_boi',
3841
enable_modules=[__name__],
39-
# debug_mode=True,
4042
)
4143
async with p.open_context(
4244
just_bp,
4345
) as (ctx, first):
44-
45-
# await tractor.breakpoint()
46-
# breakpoint()
4746
await trio.sleep_forever()
4847

4948

0 commit comments

Comments
 (0)