Enum quickwit_actors::Command
source · [−]pub enum Command {
Pause,
Resume,
ExitWithSuccess,
Observe(Sender<Box<dyn Any + Send>>),
Quit,
Kill,
}
Expand description
Commands are messages that can be send to control the behavior of an actor.
They are similar to UNIX signals.
They are treated with a higher priority than regular actor messages.
Variants
Pause
Temporarily pauses the actor. A paused actor only checks on its high priority channel and still shows “progress”. It appears as healthy to the supervisor.
Scheduled message are still processed.
Semantically, it is similar to SIGSTOP.
Resume
Resume a paused actor. If the actor was not paused this command has no effects.
Semantically, it is similar to SIGCONT.
ExitWithSuccess
Stops the actor with a success exit status code.
Upstream actors
that terminates should send the ExitWithSuccess
command to downstream actors to inform them that there are no more
incoming messages.
It is similar to Quit
, except for the resulting exit status.
Observe(Sender<Box<dyn Any + Send>>)
Asks the actor to update its ObservableState. Since it is a command, it will be treated with a higher priority than a normal message. If the actor is processing message, it will finish it, and the state observed will be the state after this message. The Observe command also ships a oneshot channel to allow client to wait on this observation.
The observation is then available using the ActorHander::last_observation()
method.
Quit
Asks the actor to gracefully shutdown.
The actor will stop processing messages and its finalize function will be called.
The exit status is then ActorExitStatus::Quit
.
This is the equivalent of sending SIGINT/Ctrl-C to a process.
Kill
Kill the actor. The behavior is the same as if an actor detected that its kill switch was pushed.
It is similar to Quit, except the ActorExitState
is different.
It can have important side effect, as the actor .finalize
method
may have different behavior depending on the exit state.
This is the equivalent of sending SIGKILL to a process.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more