Trait kabuki::Actor [] [src]

pub trait Actor {
    type Request;
    type Response;
    type Error;
    type Future: IntoFuture<Item=Self::Response, Error=Self::Error>;
    fn call(&mut self, req: Self::Request) -> Self::Future;

    fn poll(&mut self, state: ActorState) -> Async<()> { ... }
    fn poll_ready(&mut self) -> Async<()> { ... }
}

A value that manages state and responds to messages

Associated Types

The message sent to the actor

The response sent back from the actor

The response error

The internal response future. This will remain on the actor's task and will be polled to completion before being sent back to the caller.

Required Methods

Process an inbound message and return a response.

The response future will be polled until the value is realized and the response value will be sent back to the sender of the message.

Provided Methods

Poll the Actor to see if it has completed processing.

Allows the actor to advance its internal state without receiving a message. For example, if the actor sets a timeout, the task managing the actor will get notified and this function will be called.

Indicates that the actor is ready to process the next inbox message

Before the ActorCell attempts to read a message off the inbox, it will call this function. If the actor value is not ready to process a new message, the cell will wait until it is.

Implementors