Part of the core-rebuild epic — follows the shared rigor contract there.
Component
src/actor.rs, src/actor/spawn.rs, src/actor/kind.rs (~1,983 LOC). The Actor trait, lifecycle hooks (on_start/on_panic/on_stop), spawn, and the receive loop.
Learning & discussion
The loop is identity-agnostic — it survives the identity-first inversion unchanged in spirit (it just runs whatever bears the identity). A panic in a handle is actor-internal: caught and routed to on_panic; it is NOT observable via should_panic (see core-wiring latent-defects note) — probe via an on_panic observer.
Existing crates
tokio task/JoinHandle, tokio-util CancellationToken for cooperative abort (#55), futures.
Research — best algorithm/approach
Actor run-loop patterns; panic isolation (catch_unwind / task boundary); guaranteed ordering of lifecycle hooks; cooperative cancellation vs abort.
Testing — hard as fuck
Lifecycle (start → panic → restart → stop ordering; panic in on_start), sequence, defensive boundary. DST over scheduling + abort races. loom where atomics touch the run-state. Mutation: cargo-mutants, zero survivors.
Absorbs
#55 (tokio-util CancellationToken for task abort).
Part of the core-rebuild epic — follows the shared rigor contract there.
Component
src/actor.rs,src/actor/spawn.rs,src/actor/kind.rs(~1,983 LOC). TheActortrait, lifecycle hooks (on_start/on_panic/on_stop), spawn, and the receive loop.Learning & discussion
The loop is identity-agnostic — it survives the identity-first inversion unchanged in spirit (it just runs whatever bears the identity). A panic in a
handleis actor-internal: caught and routed toon_panic; it is NOT observable viashould_panic(see core-wiring latent-defects note) — probe via an on_panic observer.Existing crates
tokiotask/JoinHandle,tokio-utilCancellationTokenfor cooperative abort (#55),futures.Research — best algorithm/approach
Actor run-loop patterns; panic isolation (
catch_unwind/ task boundary); guaranteed ordering of lifecycle hooks; cooperative cancellation vs abort.Testing — hard as fuck
Lifecycle (start → panic → restart → stop ordering; panic in
on_start), sequence, defensive boundary. DST over scheduling + abort races. loom where atomics touch the run-state. Mutation:cargo-mutants, zero survivors.Absorbs
#55 (tokio-util
CancellationTokenfor task abort).