forked from goodboy/tractor
1
0
Fork 0

._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
_default_arbiter_host: str = '127.0.0.1'
_default_arbiter_port: int = 1616
_default_lo_host: str = '127.0.0.1'
_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')
@ -124,10 +130,8 @@ async def open_root_actor(
registry_addrs: list[tuple[str, int]] = (
registry_addrs
or [( # default on localhost
_default_arbiter_host,
_default_arbiter_port,
)]
or
_default_lo_addrs
)
loglevel = (loglevel or log._default_loglevel).upper()
@ -329,9 +333,7 @@ def run_daemon(
# runtime kwargs
name: str | None = 'root',
registry_addrs: list[tuple[str, int]] = [
(_default_arbiter_host, _default_arbiter_port)
],
registry_addrs: list[tuple[str, int]] = _default_lo_addrs,
start_method: str | None = None,
debug_mode: bool = False,