[−][src]Trait xtra::AsyncHandler
A trait indicating that an Actor
can handle a given Message
asynchronously, and the logic to handle the message.
Associated Types
type Responder: Future<Output = M::Result> + Send
The responding future of the asynchronous actor. This should probably look like:
ⓘThis example is not tested
type Responder<'a>: Future<Output = M::Result> + Send
Required methods
fn handle<'a>(
&'a mut self,
message: M,
ctx: &'a mut Context<Self>
) -> Self::Responder
&'a mut self,
message: M,
ctx: &'a mut Context<Self>
) -> Self::Responder
Handle a given message, returning a future eventually resolving to its result. The signature of this function should probably look like:
ⓘThis example is not tested
fn handle(&mut self, message: M, ctx: &mut Context<Self>) -> Self::Responder<'_>