From 639299e6eb1a442fbe27e7c2a18c6678396b14b2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 3 Aug 2020 15:40:41 -0400 Subject: [PATCH] Expose a `.get_registry()` method on the arbiter --- tractor/_actor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tractor/_actor.py b/tractor/_actor.py index 6b6cdef..5934d7e 100644 --- a/tractor/_actor.py +++ b/tractor/_actor.py @@ -678,7 +678,10 @@ class Actor: finally: if registered_with_arbiter: + # with trio.move_on_after(3) as cs: + # cs.shield = True await self._do_unreg(self._arb_addr) + # terminate actor once all it's peers (actors that connected # to it as clients) have disappeared if not self._no_more_peers.is_set(): @@ -863,6 +866,13 @@ class Arbiter(Actor): return None + async def get_registry( + self + ) -> Dict[str, Tuple[str, str]]: + """Return current name registry. + """ + return list(self._registry) + async def wait_for_actor( self, name: str ) -> List[Tuple[str, int]]: