1
0
Fork 0
tractor/tractor
Tyler Goodlet 7ce4bc489e Init-support for "multi homed" transports
Since we'd like to eventually allow a diverse set of transport
(protocol) methods and stacks, and a multi-peer discovery system for
distributed actor-tree applications, this reworks all runtime internals
to support multi-homing for any given tree on a logical host. In other
words any actor can now bind its transport server (currently only
unsecured TCP + `msgspec`) to more then one address available in its
(linux) network namespace. Further, registry actors (now dubbed
"registars" instead of "arbiters") can also similarly bind to multiple
network addresses and provide discovery services to remote actors via
multiple addresses which can now be provided at runtime startup.

Deats:
- adjust `._runtime` internals to use a `list[tuple[str, int]]` (and
  thus pluralized) socket address sequence where applicable for transport
  server socket binds, now exposed via `Actor.accept_addrs`:
  - `Actor.__init__()` now takes a `registry_addrs: list`.
  - `Actor.is_arbiter` -> `.is_registrar`.
  - `._arb_addr` -> `._reg_addrs: list[tuple]`.
  - always reg and de-reg from all registrars in `async_main()`.
  - only set the global runtime var `'_root_mailbox'` to the loopback
    address since normally all in-tree processes should have access to
    it, right?
  - `._serve_forever()` task now takes `listen_sockaddrs: list[tuple]`
- make `open_root_actor()` take a `registry_addrs: list[tuple[str, int]]`
  and defaults when not passed.
- change `ActorNursery.start_..()` methods take `bind_addrs: list` and
  pass down through the spawning layer(s) via the parent-seed-msg.
- generalize all `._discovery()` APIs to accept `registry_addrs`-like
  inputs and move all relevant subsystems to adopt the "registry" style
  naming instead of "arbiter":
  - make `find_actor()` support batched concurrent portal queries over
    all provided input addresses using `.trionics.gather_contexts()` Bo
  - syntax: move to using `async with <tuples>` 3.9+ style chained
    @acms.
  - a general modernization of the code to a python 3.9+ style.
  - start deprecation and change to "registry" naming / semantics:
    - `._discovery.get_arbiter()` -> `.get_registry()`
2025-03-20 19:50:31 -04:00
..
_testing Add (back) a `tractor._testing` sub-pkg 2025-03-16 15:28:28 -04:00
devx Woops, fix `_post_mortem()` type sig.. 2025-03-20 15:07:27 -04:00
experimental Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
msg Make `NamespacePath` kinda support methods.. 2025-03-15 00:05:31 -04:00
trionics Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
__init__.py Kick off `.devx` subpkg for our dev tools B) 2025-03-20 15:07:27 -04:00
_child.py ._child: remove some unused imports.. 2025-03-14 13:56:25 -04:00
_clustering.py Passthrough runtime kwargs from `open_actor_cluster()` 2022-12-11 19:56:08 -05:00
_context.py Re-revert back to `.devx` subpkg after rebase.. 2025-03-20 15:07:27 -04:00
_discovery.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
_entry.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
_exceptions.py Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_ipc.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
_mp_fixup_main.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_portal.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
_root.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
_rpc.py Re-revert back to `.devx` subpkg after rebase.. 2025-03-20 15:07:27 -04:00
_runtime.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
_spawn.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
_state.py Support a `._state.last_actor()` getter 2025-03-16 14:01:50 -04:00
_streaming.py Absorb EoCs via `Context.open_stream()` silently 2025-03-16 16:06:26 -04:00
_supervise.py Init-support for "multi homed" transports 2025-03-20 19:50:31 -04:00
log.py .log: more multi-line styling 2025-03-14 16:41:08 -04:00
to_asyncio.py Move `.to_asyncio` to modern optional value type annots 2025-03-20 15:07:27 -04:00