Struct apalis_core::worker::prelude::Monitor
source · pub struct Monitor<R> { /* private fields */ }Available on crate feature
worker only.Expand description
Implementations§
source§impl Monitor<JoinHandle<Recipient<WorkerManagement>>>
impl Monitor<JoinHandle<Recipient<WorkerManagement>>>
sourcepub fn register<W>(self, worker: W) -> Selfwhere
W: Worker,
pub fn register<W>(self, worker: W) -> Selfwhere
W: Worker,
Register single worker instance of Worker
sourcepub fn register_with_count<F, W: Worker>(self, count: usize, factory: F) -> Selfwhere
F: Fn(usize) -> W,
pub fn register_with_count<F, W: Worker>(self, count: usize, factory: F) -> Selfwhere
F: Fn(usize) -> W,
Register multiple worker instances of Worker
sourcepub async fn run_without_signals(self) -> Result<()>
pub async fn run_without_signals(self) -> Result<()>
Start monitor without listening for Ctrl + C TODO: add the signals feature
source§impl<K> Monitor<K>
impl<K> Monitor<K>
sourcepub fn event_handler<H>(self, handle: H) -> Selfwhere
H: WorkerListener + 'static,
pub fn event_handler<H>(self, handle: H) -> Selfwhere
H: WorkerListener + 'static,
Attach a new WorkerListener instance to Monitor
Trait Implementations§
source§impl Actor for Monitor<Recipient<WorkerManagement>>
impl Actor for Monitor<Recipient<WorkerManagement>>
source§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_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
source§fn mailbox_capacity(&self) -> usize
fn mailbox_capacity(&self) -> usize
Capacity of worker queue
source§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 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
source§fn preinit(self) -> InitializedActor<Self>
fn preinit(self) -> InitializedActor<Self>
Initilize actor with its address.
source§fn preinit_default() -> InitializedActor<Self>where
Self: Default,
fn preinit_default() -> InitializedActor<Self>where
Self: Default,
Initialize actor with default values
Auto Trait Implementations§
impl<R> !RefUnwindSafe for Monitor<R>
impl<R> Send for Monitor<R>where
R: Send,
impl<R> !Sync for Monitor<R>
impl<R> Unpin for Monitor<R>where
R: Unpin,
impl<R> !UnwindSafe for Monitor<R>
Blanket Implementations§
source§impl<M, S> ContextHandler<M> for Swhere
M: 'static + Message + Send,
S: Handler<M>,
impl<M, S> ContextHandler<M> for Swhere
M: 'static + Message + Send,
S: Handler<M>,
source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
__arg1: &'life1 mut Context<S>,
msg: M
) -> Pin<Box<dyn Future<Output = <S as ContextHandler<M>>::Result> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
S: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
__arg1: &'life1 mut Context<S>,
msg: M
) -> Pin<Box<dyn Future<Output = <S as ContextHandler<M>>::Result> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
S: 'async_trait,
Available on crate feature
worker only.Message handler