tractor/tractor
Tyler Goodlet 082d373947 Decouple actor-state from low-level ipc-server
As much as is possible given we currently do some graceful
cancellation join-waiting on any connected sub-actors whenever an active
`local_nursery: AcrtorNursery` in the post-rpc teardown sequence of
`handle_stream_from_peer()` is detected. In such cases we try to allow
the higher level inter-actor (task) context(s) to fully cancelled-ack
before conducting IPC machinery shutdown.

The main immediate motivation for all this is to support unit testing
the `.ipc._server` APIs but in the future may be useful for anyone
wanting to use our modular IPC transport layer sin-"actors".

Impl deats,
- drop passing an `actor: Actor` ref from as many routines in
  `.ipc._server` as possible instead opting to use
  `._state.current_actor()` where abs needed; thus the fns dropping an
  `actor` input param are:
  - `open_ipc_server()`
  - `IPCServer.listen_on()`
  - `._serve_ipc_eps()`
  - `.handle_stream_from_peer()`
- factor the above mentioned graceful remote-cancel-ack waiting into
  a new `maybe_wait_on_canced_subs()` which is called from
  `handle_stream_from_peer()` and delivers a
  maybe-`local_nursery: ActorNursery` for downstream logic; it's this
  new fn which primarily still needs to call `current_actor()`.
- in `handle_stream_from_peer()` also use `current_actor()` to check if
  a handshake is needed (or if it was called as part of some
  actor-runtime-less operation like our unit test suite!).
- also don't pass an `actor` to `._rpc.process_messages()` see how-n-why
  below..

Surrounding ipc-server client/caller adjustments,
- `._rpc.process_messages()` no longer takes an `actor` input and
  now calls `current_actor()` instead.
- `._portal.open_portal()` is adjusted to ^.
- `._runtime.async_main()` is adjusted to the `.ipc._server`'s removal
  of `actor` ref passing.

Also,
- drop some server `log.info()`s to `.runtime()`
2025-06-11 18:25:08 -04:00
..
_testing Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-05-13 12:13:12 -04:00
devx Re-impl as `DebugStatus.maybe_enter_repl_fixture()` 2025-05-18 12:33:05 -04:00
experimental Add API-modernize-todo on `experimental._pubsub.fan_out_to_ctxs` 2025-04-06 22:06:42 -04:00
ipc Decouple actor-state from low-level ipc-server 2025-06-11 18:25:08 -04:00
msg Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-05-13 12:13:12 -04:00
trionics Expose `.trionics.maybe_collapse_eg` 2025-05-05 17:45:10 -04:00
__init__.py move tractor._ipc.py into tractor.ipc._chan.py 2025-03-27 20:36:45 -03:00
_addr.py Move concrete `Address`es to each tpt module 2025-04-08 10:09:52 -04:00
_child.py Adjust `._child` instantiation of `Actor` to use newly named `uuid` arg 2025-04-06 22:06:41 -04:00
_clustering.py Clean up some imports in `._clustering` 2025-03-27 13:38:47 -04:00
_context.py Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-05-13 12:13:12 -04:00
_discovery.py Move peer-tracking attrs from `Actor` -> `IPCServer` 2025-04-11 18:11:35 -04:00
_entry.py Mv `.hide_runtime_frames()` -> `.devx._frame_stack` 2025-05-15 12:41:16 -04:00
_exceptions.py Add `TransportClosed.from_src_exc()` 2025-04-10 23:37:16 -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 Decouple actor-state from low-level ipc-server 2025-06-11 18:25:08 -04:00
_root.py Mv `.hide_runtime_frames()` -> `.devx._frame_stack` 2025-05-15 12:41:16 -04:00
_rpc.py Decouple actor-state from low-level ipc-server 2025-06-11 18:25:08 -04:00
_runtime.py Decouple actor-state from low-level ipc-server 2025-06-11 18:25:08 -04:00
_spawn.py Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-05-13 12:13:12 -04:00
_state.py Add initial `repl_fixture` support B) 2025-05-11 20:23:35 -04:00
_streaming.py Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-05-13 12:13:12 -04:00
_supervise.py Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-05-13 12:13:12 -04:00
log.py Fix ref-err on `logger` input to `get_console_log()` 2025-05-07 13:09:33 -04:00
to_asyncio.py Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-05-13 12:13:12 -04:00