forked from goodboy/tractor
1
0
Fork 0

Contain the error

eg_worker_poolz
Tyler Goodlet 2021-01-17 21:24:43 -05:00
parent da8c8c1773
commit a90a2b8787
1 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
"""
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
@ -11,7 +11,7 @@ import trio
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()}")
await trio.sleep_forever()
@ -31,4 +31,7 @@ async def main():
if __name__ == '__main__':
trio.run(main)
try:
trio.run(main)
except Exception:
print('Zombies Contained')