Trait apalis_core::worker::Actor
source · pub trait Actor: Send + Sized + 'static {
fn mailbox_capacity(&self) -> usize { ... }
fn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
{ ... }
fn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
{ ... }
fn preinit(self) -> InitializedActor<Self> { ... }
fn preinit_default() -> InitializedActor<Self>
where
Self: Default,
{ ... }
fn start<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Addr<Self>> + Send + 'async_trait>>
where
Self: 'async_trait,
{ ... }
fn start_default<'async_trait>(
) -> Pin<Box<dyn Future<Output = Addr<Self>> + Send + 'async_trait>>
where
Self: Default + 'async_trait,
{ ... }
}Available on crate feature
worker only.Expand description
Actor Trait
Provided Methods§
sourcefn mailbox_capacity(&self) -> usize
fn mailbox_capacity(&self) -> usize
Capacity of worker queue
sourcefn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
At start hook of actor
sourcefn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
At stop hook of actor
sourcefn preinit(self) -> InitializedActor<Self>
fn preinit(self) -> InitializedActor<Self>
Initilize actor with its address.
sourcefn preinit_default() -> InitializedActor<Self>where
Self: Default,
fn preinit_default() -> InitializedActor<Self>where
Self: Default,
Initialize actor with default values