forked from goodboy/tractor
1
0
Fork 0

Add a pre-started breakpoint example

sigint_ignore_in_pdb_repl
Tyler Goodlet 2022-01-26 23:38:33 -05:00
parent b7b03889d6
commit 7cee5cfa57
1 changed files with 30 additions and 0 deletions

View File

@ -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)