pub struct LoopingMutJobService(/* private fields */);
Expand description
Use this as the service type instead of LoopingJobService for mutable jobs that need to be implemented as MutJob instead of Job.
Ideally, LoopingJobService could be used for both Job and MutJob, but it is not possible to write multiple sufficiently generic implementations of From<> for LoopingJobService due to the lack of specialization and negative trait bounds.
Trait Implementations§
Source§impl<Mj: MutJob + SelfConfiguredLoop + Send + Sync + 'static> From<Mj> for LoopingMutJobService
impl<Mj: MutJob + SelfConfiguredLoop + Send + Sync + 'static> From<Mj> for LoopingMutJobService
Source§impl Service for LoopingMutJobService
impl Service for LoopingMutJobService
Source§fn run_forever<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Never> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run_forever<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Never> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The service is never expected to stop, it should do its job until
externally shutdown.
Source§fn set_heartbeat(&mut self, heartbeat: Arc<dyn Heartbeat>)
fn set_heartbeat(&mut self, heartbeat: Arc<dyn Heartbeat>)
The service should frequently call “beat” to indicate that it is still
alive.
Source§fn heartbeat_ttl(&self) -> i32
fn heartbeat_ttl(&self) -> i32
The maximum amount of seconds allowed between heartbeats before the
service is deemed “dead”
Source§fn is_healthy(&self) -> bool
fn is_healthy(&self) -> bool
The service should be able to self-diagnose any internal issues and
report if there is a problem.
Auto Trait Implementations§
impl !Freeze for LoopingMutJobService
impl !RefUnwindSafe for LoopingMutJobService
impl Send for LoopingMutJobService
impl Sync for LoopingMutJobService
impl Unpin for LoopingMutJobService
impl !UnwindSafe for LoopingMutJobService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more