Expand description
Actor lifecycle task orchestration.
ActorTask deliberately uses four separate unbounded mpsc receivers instead
of one tagged command queue:
lifecycle_inboxcarries trusted registry/envoy lifecycle commands: start, stop, destroy, and driver-alarm wakeups.dispatch_inboxcarries client-facing actor work such as actions, raw HTTP, raw WebSockets, and inspector workflow requests.lifecycle_eventscarries internal subsystem signals fromActorContext: save requests, activity changes, inspector attach changes, and sleep ticks.actor_event_rxfeeds the user runtime adapter with actor events afterActorTaskaccepts dispatch work.
Keeping these queues split gives the task loop explicit priority boundaries.
Client dispatch does not compete directly with lifecycle stop/destroy
commands, and internal save/sleep/inspector events do not compete with
untrusted client traffic. The main tokio::select! is biased so lifecycle
commands are observed first, then internal lifecycle events, then dispatch
and timers. During sleep grace, the same priority keeps lifecycle handling
live while still draining accepted dispatch replies before final teardown.
The sender topology follows the trust boundary: registry/envoy owns lifecycle
and dispatch senders, core subsystems enqueue lifecycle events through
ActorContext, and only ActorTask forwards accepted work into the
actor-event stream consumed by user code.
Re-exports§
pub use crate::actor::task_types::LifecycleState;