forked from goodboy/tractor
1
0
Fork 0

Contain the error

actor_state_via_messages
Tyler Goodlet 2021-01-17 21:24:43 -05:00
parent 582eda4afd
commit 47651eaf91
1 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
""" """
Run with a process monitor from a terminal using: Run with a process monitor from a terminal using:
$TERM -e watch -n 0.1 "pstree -a $$" & python examples/parallelism/we_are_processes.py || kill $! $TERM -e watch -n 0.1 "pstree -a $$" & python examples/parallelism/we_are_processes.py && kill $!
""" """
from multiprocessing import cpu_count from multiprocessing import cpu_count
@ -11,7 +11,7 @@ import trio
async def target(): async def target():
print(f"Yo, i'm {tractor.current_actor().name} " print(f"Yo, i'm '{tractor.current_actor().name}' "
f"running in pid {os.getpid()}") f"running in pid {os.getpid()}")
await trio.sleep_forever() await trio.sleep_forever()
@ -31,4 +31,7 @@ async def main():
if __name__ == '__main__': if __name__ == '__main__':
trio.run(main) try:
trio.run(main)
except Exception:
print('Zombies Contained')