tractor/tractor
Tyler Goodlet 2d6b3922a6 Unwrap `UDSAddress` as `tuple[str, str]`, i.e. sin pid
Since in hindsight the real analog of a net-proto's "bindspace"
(normally its routing layer's addresses-port-set) is more akin to the
"location in the file-system" for a UDS socket file (aka the file's
parent directory) determines whether or not the "port" (aka it's
file-name) collides with any other.

So the `._filedir: Path` is like the allocated "address" and,
the `._filename: Path|str` is basically the "port",

at least in my mind.. Bp

Thinking about fs dirs like a "host address" means you can get
essentially the same benefits/behaviour of say an (ip)
addresses-port-space but using the (current process-namespace's)
filesys-tree. Note that for UDS sockets in particular the
network-namespace is what would normally isolate so called "abstract
sockets" (i.e. UDS sockets that do NOT use file-paths by setting `struct
sockaddr_un.sun_path = 'abstract', see `man unix`); using directories is
even easier and definitely more explicit/readable/immediately-obvious as
a human-user.

As such this reworks all the necessary `UDSAddress` meths,
- `.unwrap()` now returns a `tuple(str(._filedir, str(._filename))`,
- `wrap_address()` now matches UDS on a 2nd tuple `str()` element,
- `.get_root()` no longer passes `maybe_pid`.

AND adjusts `MsgpackUDSStream` to,
- use the new `unwrap_sockpath()` on the `socket.get[sock/peer]name()`
  output before passing directly as `UDSAddress.__init__(filedir, filename)`
  instead of via `.from_addr()`.
- also pass `maybe_pid`s to init since no longer included in the
  unwrapped-type form.
2025-04-03 22:24:24 -04:00
..
_testing Improve test_ringbuf test, drop MsgTransport ring buf impl for now in favour of a trio.abc.Channel[bytes] impl, add docstrings 2025-03-27 20:36:46 -03:00
devx Move `DebugRequestError` to `._exceptions` 2025-04-02 22:50:03 -04:00
experimental Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
ipc Unwrap `UDSAddress` as `tuple[str, str]`, i.e. sin pid 2025-04-03 22:24:24 -04:00
msg Add an `Actor.pformat()` 2025-04-01 22:21:28 -04:00
trionics Use `collapse_eg()` in broadcaster suite 2025-03-27 13:38:47 -04:00
__init__.py move tractor._ipc.py into tractor.ipc._chan.py 2025-03-27 20:36:45 -03:00
_addr.py Unwrap `UDSAddress` as `tuple[str, str]`, i.e. sin pid 2025-04-03 22:24:24 -04:00
_child.py Adjust `._child` instantiation of `Actor` to use newly named `uuid` arg 2025-03-30 22:53:36 -04:00
_clustering.py Clean up some imports in `._clustering` 2025-03-27 13:38:47 -04:00
_context.py Change some low-hanging `.uid`s to `.aid` 2025-04-03 13:19:19 -04:00
_discovery.py s/`._addr.preferred_transport`/`_state._def_tpt_proto` 2025-04-03 20:22:52 -04:00
_entry.py Adjust imports to use new `UnwrappedAddress` 2025-03-30 21:24:48 -04:00
_exceptions.py Repair weird spawn test, start `test_root_runtime` 2025-04-03 16:15:53 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_mp_fixup_main.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_multiaddr.py Fix doc string "its" typo.. 2025-03-20 19:50:31 -04:00
_portal.py Mv to `Channel._do_handshake()` in `open_portal()` 2025-04-03 13:14:58 -04:00
_root.py s/`._addr.preferred_transport`/`_state._def_tpt_proto` 2025-04-03 20:22:52 -04:00
_rpc.py Some more log message tweaks 2025-04-03 13:30:48 -04:00
_runtime.py s/`._addr.preferred_transport`/`_state._def_tpt_proto` 2025-04-03 20:22:52 -04:00
_spawn.py Change some low-hanging `.uid`s to `.aid` 2025-04-03 13:19:19 -04:00
_state.py s/`._addr.preferred_transport`/`_state._def_tpt_proto` 2025-04-03 20:22:52 -04:00
_streaming.py Some more log message tweaks 2025-04-03 13:30:48 -04:00
_supervise.py s/`._addr.preferred_transport`/`_state._def_tpt_proto` 2025-04-03 20:22:52 -04:00
log.py move tractor._ipc.py into tractor.ipc._chan.py 2025-03-27 20:36:45 -03:00
to_asyncio.py Continue supporting py3.11+ 2025-03-27 13:24:25 -04:00