2020-10-04 13:54:36 +00:00
|
|
|
import trio
|
|
|
|
import tractor
|
|
|
|
|
|
|
|
|
|
|
|
async def breakpoint_forever():
|
2024-04-14 22:53:42 +00:00
|
|
|
'''
|
|
|
|
Indefinitely re-enter debugger in child actor.
|
|
|
|
|
|
|
|
'''
|
2020-10-04 13:54:36 +00:00
|
|
|
while True:
|
|
|
|
await trio.sleep(0.1)
|
2024-04-14 22:53:42 +00:00
|
|
|
await tractor.pause()
|
2020-10-04 13:54:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def main():
|
|
|
|
|
2021-02-24 18:39:14 +00:00
|
|
|
async with tractor.open_nursery(
|
|
|
|
debug_mode=True,
|
2024-04-14 22:53:42 +00:00
|
|
|
loglevel='cancel',
|
2021-02-24 18:39:14 +00:00
|
|
|
) as n:
|
2020-10-04 13:54:36 +00:00
|
|
|
|
|
|
|
portal = await n.run_in_actor(
|
|
|
|
breakpoint_forever,
|
|
|
|
)
|
|
|
|
await portal.result()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2021-02-24 18:39:14 +00:00
|
|
|
trio.run(main)
|