Add project name to pyproject.toml and decouple registry from binding addresses #4

Open
jc211 wants to merge 2 commits from jc211/tractor:runtime_to_msgspec into runtime_to_msgspec
2 changed files with 7 additions and 8 deletions

View File

@ -120,6 +120,7 @@ log_cli = false
# ------ - ------
[project]
name = "tractor"
keywords = [
'trio',
'async',

View File

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