tractor/tractor
Gud Boi 63df5534bb Add `tractor.to_actor` one-shot task API subpkg
First cut at the `to_thread`/`to_process`-style "run it over there"
wrapper layer from issue #477: a single-remote-task invocation API
decoupled from the `ActorNursery` spawn machinery, composed purely
from the lower level daemon-actor + portal primitives,

- `to_actor.run(fn, **fn_kwargs)` spawns a subactor via
  `ActorNursery.start_actor()`, schedules `fn` as its lone task
  with `Portal.run()` and ALWAYS reaps it via a `finally`-scoped
  `Portal.cancel_actor()` (whose bounded cancel-req wait is
  internally shielded so the reap also runs under caller-scope
  cancellation).
- remote errors raise directly in the caller's task as boxed
  `RemoteActorError`s, moving error collection/propagation up into
  whatever local `trio` scope encloses the call.
- "placement" opts: `portal=` reuses a running actor (no
  spawn/reap), `an=` spawns from a caller-managed actor-nursery,
  neither opens a private call-scoped `open_nursery()` (implicitly
  booting the runtime, tunable via pass-through `runtime_kwargs`).
- fail-fast validation BEFORE any spawn: non-streaming async fn
  only (same constraint as `Portal.run()`), `portal=`/`an=` mutual
  exclusion and no `runtime_kwargs` alongside a placement opt.

Also,
- x-ref the successor API from `.run_in_actor()`'s deprecation TODO
  + docstring; emitting a formal `DeprecationWarning` waits on
  migrating in-repo usage.
- log prompt-io provenance per NLNet policy incl. the driver prompt
  file.

Prompt-IO: ai/prompt-io/claude/20260702T154255Z_65bf9df5_prompt_io.md

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-07-02 12:10:19 -04:00
..
_testing Uniquify no-runtime UDS `get_random()` paths 2026-06-29 18:08:50 -04:00
devx Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
discovery Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
experimental Use `aid.uid` over manual `(name, uuid)` tuples 2026-06-27 21:38:30 -04:00
ipc Fix uds `get_random` reaper-regex break (+2 nits) 2026-06-29 18:51:26 -04:00
msg Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
runtime Add `tractor.to_actor` one-shot task API subpkg 2026-07-02 12:10:19 -04:00
spawn Add `tractor.spawn._reap.unlink_uds_bind_addrs()` 2026-06-17 17:39:44 -04:00
to_actor Add `tractor.to_actor` one-shot task API subpkg 2026-07-02 12:10:19 -04:00
trionics Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
__init__.py Add `tractor.to_actor` one-shot task API subpkg 2026-07-02 12:10:19 -04:00
_child.py Add per-actor `setproctitle` via `devx._proctitle` 2026-06-17 17:39:44 -04:00
_clustering.py Use `.aid.uid` to avoid deprecation warns 2026-03-13 21:10:52 -04:00
_code_load.py Mv `load_module_from_path()` to a new `._code_load` submod 2026-02-11 21:03:29 -05:00
_context.py Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
_exceptions.py Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
_root.py Code-style, couple newline/ws tweaks 2026-06-24 16:20:50 -04:00
_streaming.py Use `aid.uid` over manual `(name, uuid)` tuples 2026-06-27 21:38:30 -04:00
log.py Fix `add_log_level()` re-registration value drift 2026-06-24 18:03:28 -04:00
to_asyncio.py Add `maybe_signal_aio_task()` + cause-chain guard 2026-06-17 17:39:44 -04:00