forked from goodboy/tractor
1
0
Fork 0

Remove tractor run from some debug examples

mp_hang_search
Tyler Goodlet 2021-02-23 06:48:15 -05:00
parent 8fabd27dbe
commit b7b2436bc1
2 changed files with 12 additions and 6 deletions

View File

@ -17,10 +17,13 @@ async def name_error():
async def main(): async def main():
"""Test breakpoint in a streaming actor. """Test breakpoint in a streaming actor.
""" """
async with tractor.open_nursery() as n: async with tractor.open_nursery(
debug_mode=True,
loglevel='error',
) as n:
p0 = await n.start_actor('bp_forever', rpc_module_paths=[__name__]) p0 = await n.start_actor('bp_forever', enable_modules=[__name__])
p1 = await n.start_actor('name_error', rpc_module_paths=[__name__]) p1 = await n.start_actor('name_error', enable_modules=[__name__])
# retreive results # retreive results
stream = await p0.run(breakpoint_forever) stream = await p0.run(breakpoint_forever)
@ -28,4 +31,4 @@ async def main():
if __name__ == '__main__': if __name__ == '__main__':
tractor.run(main, debug_mode=True, loglevel='error') trio.run(main)

View File

@ -1,3 +1,4 @@
import trio
import tractor import tractor
@ -50,7 +51,9 @@ async def main():
python -m tractor._child --uid ('spawn_until_0', 'de918e6d ...) python -m tractor._child --uid ('spawn_until_0', 'de918e6d ...)
""" """
async with tractor.open_nursery() as n: async with tractor.open_nursery(
debug_mode=True,
) as n:
# spawn both actors # spawn both actors
portal = await n.run_in_actor( portal = await n.run_in_actor(
@ -70,4 +73,4 @@ async def main():
if __name__ == '__main__': if __name__ == '__main__':
tractor.run(main, debug_mode=True) trio.run(main)