From 86ed8111d86d89331aa255d4e1a5ba3eacd95b61 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 20 Jul 2020 19:50:47 -0400 Subject: [PATCH] Make sure to wait trio processes on teardown --- tractor/_spawn.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tractor/_spawn.py b/tractor/_spawn.py index 4ae2ce4..eaa7270 100644 --- a/tractor/_spawn.py +++ b/tractor/_spawn.py @@ -168,11 +168,13 @@ async def run_in_process(async_fn, *args, **kwargs): stdin=subprocess.PIPE ) + # send over func to call await p.stdin.send_all(encoded_job) yield p - #return cloudpickle.loads(p.stdout) + # wait for termination + await p.wait() async def new_proc(