Skip to main content

Module task

Module task 

Source
Expand description

Actor lifecycle task orchestration.

ActorTask deliberately uses four separate unbounded mpsc receivers instead of one tagged command queue:

  • lifecycle_inbox carries trusted registry/envoy lifecycle commands: start, stop, destroy, and driver-alarm wakeups.
  • dispatch_inbox carries client-facing actor work such as actions, raw HTTP, raw WebSockets, and inspector workflow requests.
  • lifecycle_events carries internal subsystem signals from ActorContext: save requests, activity changes, inspector attach changes, and sleep ticks.
  • actor_event_rx feeds the user runtime adapter with actor events after ActorTask accepts 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;

Structs§

ActorTask

Enums§

DispatchCommand
LifecycleCommand
LifecycleEvent

Type Aliases§

ActionDispatchResult
HttpDispatchResult