pub struct Monitor<R> { /* private fields */ }Available on crate feature
worker only.Expand description
Implementations
sourceimpl Monitor<JoinHandle<Recipient<WorkerManagement>>>
impl Monitor<JoinHandle<Recipient<WorkerManagement>>>
sourcepub fn register<W>(self, worker: W) -> Self where
W: Worker,
pub fn register<W>(self, worker: W) -> Self where
W: Worker,
Register single worker instance of Worker
sourcepub fn register_with_count<F, W: Worker>(self, count: usize, factory: F) -> Self where
F: Fn(usize) -> W,
pub fn register_with_count<F, W: Worker>(self, count: usize, factory: F) -> Self where
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
sourceimpl<K> Monitor<K>
impl<K> Monitor<K>
sourcepub fn event_handler<H: 'static>(self, handle: H) -> Self where
H: WorkerListener,
pub fn event_handler<H: 'static>(self, handle: H) -> Self where
H: WorkerListener,
Attach a new WorkerListener instance to Monitor
Trait Implementations
sourceimpl Actor for Monitor<Recipient<WorkerManagement>>
impl Actor for Monitor<Recipient<WorkerManagement>>
sourcefn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
At start hook of actor
sourcefn mailbox_capacity(&self) -> usize
fn mailbox_capacity(&self) -> usize
Capacity of worker queue
sourcefn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
sourceimpl Handler<WorkerMessage> for Monitor<Recipient<WorkerManagement>>
impl Handler<WorkerMessage> for Monitor<Recipient<WorkerManagement>>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<M, S> ContextHandler<M> for S where
M: 'static + Message + Send,
S: Handler<M>,
impl<M, S> ContextHandler<M> for S where
M: 'static + Message + Send,
S: Handler<M>,
sourcefn 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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more