From aba46b723b0a23cc1c75c777d63ccd9db2a8b346 Mon Sep 17 00:00:00 2001 From: Jad Abou-Chakra <29726242+jc211@users.noreply.github.com> Date: Thu, 19 Sep 2024 18:17:20 +1000 Subject: [PATCH] Decouple registery addresses from binding addresses --- tractor/_root.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tractor/_root.py b/tractor/_root.py index 7cdef60..3b8bd15 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -69,7 +69,10 @@ async def open_root_actor( # defaults are above arbiter_addr: tuple[str, int]|None = None, - + + # binding addrs for the transport layer server + trans_bind_addrs: list[tuple[str, int]] = [(_default_host, _default_port)], + name: str|None = 'root', # either the `multiprocessing` start method: @@ -183,6 +186,8 @@ async def open_root_actor( _default_lo_addrs ) assert registry_addrs + + assert trans_bind_addrs loglevel = ( loglevel @@ -273,8 +278,6 @@ async def open_root_actor( tuple(addr), # TODO: just drop this requirement? ) - trans_bind_addrs: list[tuple[str, int]] = [] - # Create a new local root-actor instance which IS NOT THE # REGISTRAR if ponged_addrs: @@ -296,11 +299,6 @@ async def open_root_actor( loglevel=loglevel, enable_modules=enable_modules, ) - # DO NOT use the registry_addrs as the transport server - # addrs for this new non-registar, root-actor. - for host, port in ponged_addrs: - # NOTE: zero triggers dynamic OS port allocation - trans_bind_addrs.append((host, 0)) # Start this local actor as the "registrar", aka a regular # actor who manages the local registry of "mailboxes" of