Add watch/unwatch API to the actor system so actors can monitor each other's liveness. When a watched actor dies (panic or stop), watchers receive an ActorExited notification via on_actor_exit(). - ExitReason enum (Stopped, Panicked, NodeDown) and ActorExited struct - ContextInner::watch()/unwatch() + Ctx typed wrappers - ActorInterface::on_actor_exit() default method (system message fallback) - WatchRegistry in worker with bidirectional tracking - Death notification dispatch as phase 5b in tick_once - Runtime-level watch for external callers - 10 behavioral tests in tests/watch_api.rs - Design documents for OS features in docs/os-design/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
Progress
Completed
Feature 1: Actor Watching (local only) — docs/os-design/01-actor-watching.md
- Added
ExitReasonenum (Stopped, Panicked, NodeDown) andActorExitedstruct tosrc/actor.rs - Extended
ContextInnertrait withwatch()/unwatch()methods - Added
Ctx::watch(target)andCtx::unwatch(target)typed API - Added
on_actor_exit()default method toActorInterfacetrait - Updated
AnyActor::handle_anywith system message fallback (triesActorExitedafterIncoming) - Implemented
WatchRegistryinsrc/worker.rs(bidirectional HashMap tracking) - Integrated death notification dispatch as phase 5b in
tick_once - Implemented
watch/unwatchonRuntime'sContextInnerimpl - Added
watch_registryfield toTickContextinsrc/delivery.rs - 10 behavioral tests in
tests/watch_api.rs— all passing - All 53 tests pass (42 existing + 10 new + 1 doctest)
- All 134 distribution crate tests pass
Next Steps
- Command Interface —
docs/os-design/04-command-interface.md- Create
crates/command/crate withCommandHandlertrait,CommandRouter,CommandRequest/CommandResponsetypes - Extract existing
cmd_*functions fromcrates/runtime-dashboard/src/investigate.rsinto CommandHandler impls - Add built-in read commands (help, overview, nodes, workers, actors)
- Add built-in write commands (spawn, stop, send, drain, shutdown)
- Write behavioral tests
- Create
- Cluster Registry —
docs/os-design/02-cluster-registry.md - Node Capabilities —
docs/os-design/03-node-capabilities.md - Remote Watching — extends 01-actor-watching with wire protocol
- Supervision —
docs/os-design/05-supervision.md
Open Questions
- Command Interface: Should custom actor commands (via
Ctx::register_command()) be deferred to a later PR? - Should the dashboard migration happen in the same PR as the command crate creation?
Blockers
- None