pub enum ActorExitStatus {
Success,
Quit,
DownstreamClosed,
Killed,
Failure(Arc<Error>),
Panicked,
}
Expand description
The actor exit status represents the outcome of the execution of an actor, after the end of the execution.
It is in many ways, similar to the exit status code of a program.
Variants§
Success
The actor successfully exited.
It happens either because:
- all of the existing mailboxes were dropped and the actor message queue was exhausted. No new message could ever arrive to the actor. (This exit is triggered by the framework.) or
- the actor
process_message
method returnedErr(ExitStatusCode::Success)
. (This exit is triggered by the actor implementer.)
(This is equivalent to exit status code 0.) Note that this is not really an error.
Quit
The actor was asked to gracefully shutdown.
(Semantically equivalent to exit status code 130, triggered by SIGINT aka Ctrl-C, or SIGQUIT)
DownstreamClosed
The actor tried to send a message to a dowstream actor and failed. The logic ruled that the actor should be killed.
(Semantically equivalent to exit status code 141, triggered by SIGPIPE)
Killed
The actor was killed.
It can happen because:
- it received
Command::Kill
. - its kill switch was activated.
(Semantically equivalent to exit status code 137, triggered by SIGKILL)
Failure(Arc<Error>)
An unexpected error happened while processing a message.
Panicked
The thread or the task executing the actor loop panicked.
Implementations§
Source§impl ActorExitStatus
impl ActorExitStatus
pub fn is_success(&self) -> bool
Trait Implementations§
Source§impl Clone for ActorExitStatus
impl Clone for ActorExitStatus
Source§fn clone(&self) -> ActorExitStatus
fn clone(&self) -> ActorExitStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more