forked from goodboy/tractor
1
0
Fork 0

Expose a `.get_registry()` method on the arbiter

ensure_deregister
Tyler Goodlet 2020-08-03 15:40:41 -04:00
parent 2ccaa94c60
commit 639299e6eb
1 changed files with 10 additions and 0 deletions

View File

@ -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]]: