tractor/tractor
Tyler Goodlet 9a18b57d38 Mega-refactor on `._invoke()` targeting `@context`s
Since eventually we want to implement all other RPC "func types" as
contexts underneath this starts the rework to move all the other cases
into a separate func not only to simplify the main `._invoke()` body but
also as a reminder of the intention to do it XD

Details of re-factor:
- add a new `._invoke_non_context()` which just moves all the old blocks
  for non-context handling to a single def.
- factor what was basically just the `finally:` block handler (doing all
  the task bookkeeping) into a new `@acm`: `_errors_relayed_via_ipc()`
  with that content packed into the post-`yield` (also with a `hide_tb:
  bool` flag added of course).
  * include a `debug_kbis: bool` for when needed.
- since the `@context` block is the only type left in the main
  `_invoke()` body, de-dent it so it's more grok-able B)

Obviously this patch also includes a few improvements regarding
context-cancellation-semantics (for the `context` RPC case) on the
callee side in order to match previous changes to the `Context` api:
- always setting any ctxc as the `Context._local_error`.
- using the new convenience `.maybe_raise()` topically (for now).
- avoiding any previous reliance on `Context.cancelled_caught` for
  anything public of meaning.

Further included is more logging content updates:
- being pedantic in `.cancel()` msgs about whether termination is caused
  by error or ctxc.
- optional `._invoke()` traceback hiding via a `hide_tb: bool`.
- simpler log headers throughout instead leveraging new `.__repr__()` on
  primitives.
- buncha `<= <actor-uid>` sent some message emissions.
- simplified handshake statuses reporting.

Other subsys api changes we need to match:
- change to `Channel.transport`.
- avoiding any `local_nursery: ActorNursery` waiting when the
  `._implicit_runtime_started` is set.

And yes, lotsa more comments for #TODOs dawg.. since there's always
somethin!
2024-03-02 22:12:00 -05:00
..
devx Support `maybe_wait_for_debugger(header_msg: str)` 2024-02-22 15:08:10 -05:00
experimental Move move context code into new `._context` mod 2023-05-15 10:00:45 -04:00
msg Make `NamespacePath` kinda support methods.. 2024-02-29 17:37:02 -05:00
trionics Try allowing multi-pops of `_Cache.locks` for now? 2024-01-23 11:13:07 -05:00
__init__.py Use `import <name> as <name>,` style over `__all__` in pkg mod 2024-01-02 10:25:17 -05:00
_child.py ._child: remove some unused imports.. 2024-01-02 10:24:39 -05:00
_clustering.py Passthrough runtime kwargs from `open_actor_cluster()` 2022-12-11 19:56:08 -05:00
_context.py Deep `Context` refinements 2024-03-01 22:37:32 -05:00
_discovery.py `.discovery.get_arbiter()`: add warning around this now deprecated usage 2023-12-11 19:37:45 -05:00
_entry.py Add field-first subproca `.info()` to `._entry` 2024-02-29 20:01:39 -05:00
_exceptions.py Add "fancier" remote-error `.__repr__()`-ing 2024-02-29 18:56:31 -05:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_ipc.py Fix `Channel.__repr__()` safety, renames to `._transport` 2024-02-29 18:37:04 -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.. 2023-11-06 15:44:21 -05:00
_portal.py Avoid `ctx.cancel()` after ctxc rxed in `.open_context()` 2024-03-02 17:18:55 -05:00
_root.py Make stream draining status logs `.debug()` level 2024-03-01 19:27:10 -05:00
_runtime.py Mega-refactor on `._invoke()` targeting `@context`s 2024-03-02 22:12:00 -05:00
_shm.py Updates from latest `piker.data._sharedmem` changes 2023-06-22 17:16:17 -04:00
_spawn.py Spawn naming and log format tweaks 2024-03-01 11:37:23 -05:00
_state.py Move `NoRuntime` import inside `current_actor()` to avoid cycle 2023-05-15 10:00:45 -04:00
_streaming.py Make stream draining status logs `.debug()` level 2024-03-01 19:27:10 -05:00
_supervise.py Add `._implicit_runtime_started` mark, better logs 2024-03-01 15:44:01 -05:00
log.py .log: more multi-line styling 2024-02-20 13:22:44 -05:00
to_asyncio.py Move `.to_asyncio` to modern optional value type annots 2023-07-21 15:08:46 -04:00