From 213447008b90375e415125d472f7050d83cd6665 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 15 Dec 2021 14:27:01 -0500 Subject: [PATCH] Add draft code for waiting on all nurseries in root --- tractor/_root.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tractor/_root.py b/tractor/_root.py index fc727d4..3468a25 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -215,6 +215,14 @@ async def open_root_actor( raise finally: + # NOTE: not sure if we'll ever need this but it's + # possibly better for even more determinism? + # logger.cancel(f'Waiting on {len(nurseries)} nurseries in root..') + # nurseries = actor._actoruid2nursery.values() + # async with trio.open_nursery() as tempn: + # for an in nurseries: + # tempn.start_soon(an.exited.wait) + logger.cancel("Shutting down root actor") await actor.cancel() finally: