Skip to content

Commit

Permalink
Add a pre-started breakpoint example
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Jan 30, 2022
1 parent 5abd4c1 commit d762bba
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions examples/debugging/subactor_bp_in_ctxt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import tractor
import trio


@tractor.context
async def just_bp(
ctx: tractor.Context,
) -> None:

await tractor.breakpoint()
await ctx.started('yo bpin here')


async def main():
async with tractor.open_nursery(
debug_mode=True,
) as n:
p = await n.start_actor(
'bp_boi',
enable_modules=[__name__],
)
async with p.open_context(
just_bp,
) as (ctx, first):

await trio.sleep_forever()


if __name__ == '__main__':
trio.run(main)

0 comments on commit d762bba

Please sign in to comment.