._root: set a `_default_lo_addrs` and apply it when not provided by caller

multihomed
Tyler Goodlet 2023-10-18 14:12:58 -04:00
parent ca3f7a1b6b
commit fcc8cee9d3
1 changed files with 11 additions and 9 deletions

View File

@ -46,8 +46,14 @@ from ._exceptions import is_multi_cancelled
# set at startup and after forks # set at startup and after forks
_default_arbiter_host: str = '127.0.0.1' _default_lo_host: str = '127.0.0.1'
_default_arbiter_port: int = 1616 _default_port: int = 1616
# default registry always on localhost
_default_lo_addrs: list[tuple[str, int]] = [(
_default_lo_host,
_default_port,
)]
logger = log.get_logger('tractor') logger = log.get_logger('tractor')
@ -124,10 +130,8 @@ async def open_root_actor(
registry_addrs: list[tuple[str, int]] = ( registry_addrs: list[tuple[str, int]] = (
registry_addrs registry_addrs
or [( # default on localhost or
_default_arbiter_host, _default_lo_addrs
_default_arbiter_port,
)]
) )
loglevel = (loglevel or log._default_loglevel).upper() loglevel = (loglevel or log._default_loglevel).upper()
@ -329,9 +333,7 @@ def run_daemon(
# runtime kwargs # runtime kwargs
name: str | None = 'root', name: str | None = 'root',
registry_addrs: list[tuple[str, int]] = [ registry_addrs: list[tuple[str, int]] = _default_lo_addrs,
(_default_arbiter_host, _default_arbiter_port)
],
start_method: str | None = None, start_method: str | None = None,
debug_mode: bool = False, debug_mode: bool = False,