Trait quickwit_actors::Handler
source · [−]pub trait Handler<M>: Actor {
type Reply: 'static + Send;
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: M,
ctx: &'life1 ActorContext<Self>
) -> Pin<Box<dyn Future<Output = Result<Self::Reply, ActorExitStatus>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn message_span(&self, msg_id: u64, _msg: &M) -> Span { ... }
}
Required Associated Types
Required Methods
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: M,
ctx: &'life1 ActorContext<Self>
) -> Pin<Box<dyn Future<Output = Result<Self::Reply, ActorExitStatus>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: M,
ctx: &'life1 ActorContext<Self>
) -> Pin<Box<dyn Future<Output = Result<Self::Reply, ActorExitStatus>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Processes a message.
If an exit status is returned as an error, the actor will exit. It will stop processing more message, the finalize method will be called, and its exit status will be the one defined in the error.
Provided Methods
fn message_span(&self, msg_id: u64, _msg: &M) -> Span
fn message_span(&self, msg_id: u64, _msg: &M) -> Span
Returns a context span for the processing of a specific message.
msg_id
is an autoincremented message id than can be added to the span.
The counter starts 0 at the beginning of the life of an actor instance.