Trait actix_signal::AddrSignalExt
source · pub trait AddrSignalExt {
// Required methods
fn stop(&self);
fn terminate(&self);
}
Expand description
An extension trait for Addr
s that provides convenient methods to control associated actors’ lifecycle.
The actor must implement the SignalHandler
trait for these methods to work.
§Delayed operation
These methods are different from their context counterparts which have immediate effects. Instead, they are queued to the mailbox, subjecting to message sending and handling delays. Moreover, if the actor stops/terminates/panics before handling the signal, no actual operation will be performed.
§Signal convention
There’s no guarantee how the actor may react to signals. A misbehaved actor may act completely different from your intention.
See signals
module for details.
Required Methods§
sourcefn stop(&self)
fn stop(&self)
Stop the actor associated with the address.
This method should have the same effect as ActorContext::stop.
sourcefn terminate(&self)
fn terminate(&self)
Terminate the actor associated with the address.
This method should have the same effect as ActorContext::terminate.