pub trait EventConsumer<E: Event>:
Send
+ Sync
+ 'static {
type Error: Error + Send + Sync + Sized + 'static;
// Required methods
fn accept<'life0, 'async_trait>(
&'life0 self,
event: E,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn accept_sync(&self, event: E) -> Result<(), Self::Error>;
}Expand description
The inbox side of an Actor
Required Associated Types§
Required Methods§
Sourcefn accept<'life0, 'async_trait>(
&'life0 self,
event: E,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn accept<'life0, 'async_trait>(
&'life0 self,
event: E,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Accepts an event
This method can run long running computation, but is strongly encouraged to properly utilize the blocking thread pool.
§Errors
Will return an error if communication with the actor fails