pub enum LifeCycle {
Starting,
Receiving,
Stopping,
Terminated,
Restarting,
}Expand description
Lifecycle state of a registered actor as tracked by actor_system_loop.
Drives which lifecycle hook fires next and whether FindActor reports
the actor as ready for delivery:
Starting/Restarting→ mailbox exists butFindActorreturnsready=false; the system loop reports the actor isn’t ready yet.Receiving→ normal operation; sends go through immediately.Stopping/Terminated→ terminal phase; the actor task is winding down or finished. Subsequent sends fail.
Variants§
Starting
Initial state right after Register is accepted but before
pre_start finishes. Sends are queued (ready=false).
Receiving
Active state. pre_start (or post_restart) has returned and the
actor is consuming messages from its mailbox.
Stopping
Transitional state entered when the actor receives a kill or
restart signal, or its handler returns Err under ErrorHandling::Stop.
post_stop is about to run.
Terminated
Final state after post_stop; the actor’s task has exited.
Restarting
Transitional state between Stopping and the next Starting, set
when the actor is restarting (handler error under ErrorHandling::Restart
or an explicit restart call). pre_restart runs here.