tractor/examples/parallelism
Gud Boi b16173482b Rework landing example onto the `Context` API
`run_in_actor()` is slated to become a hilevel wrapper
(`runtime/_supervise.py` "TODO: DEPRECATE THIS"), so the showcase
`we_are_processes.py` shouldn't lead with it. Move it to the modern
API: each `worker_<i>` subactor runs a `@tractor.context`
`endpoint()` that `started()`-hands its name + pid back over
`Portal.open_context()` and parks; the root sleeps then raises on
purpose so the runtime reaps the whole tree (zero zombies).

The subs spawn concurrently from bg `trio.Task`s so each child's
cold `import tractor` (~0.4s, see #470) overlaps instead of
stacking; a comment flags the coming `main_thread_forkserver`
backend (#463) which'll make serial spawns cheap enough to just
loop.

Match the landing prose to the snippet — name the `Context` +
`started()` handshake it now leads with.

Also, document `--watch examples` on the `sphinx-autobuild` cmds so
edits to `literalinclude`-d example scripts (which live outside
`docs/`) live-reload too.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-06-27 21:59:04 -04:00
..
concurrent_actors_primes.py Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
concurrent_futures_primes.py Un-hide stdlib primes example, add `trio` shim 2026-06-25 13:01:10 -04:00
single_func.py Use `.wait_for_result()` in dated examples 2026-06-25 13:01:10 -04:00
we_are_processes.py Rework landing example onto the `Context` API 2026-06-27 21:59:04 -04:00