pub struct GenBackgroundService<A> {
pub threads: Option<usize>,
/* private fields */
}Expand description
A generic type of background service
Fields§
§threads: Option<usize>The number of threads. Default is 1
Implementations§
Trait Implementations§
Source§impl<A> ServiceWithDependents for GenBackgroundService<A>
impl<A> ServiceWithDependents for GenBackgroundService<A>
Source§fn start_service<'life0, 'async_trait>(
&'life0 mut self,
_fds: Option<ListenFds>,
shutdown: ShutdownWatch,
_listeners_per_fd: usize,
ready: ServiceReadyNotifier,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_service<'life0, 'async_trait>(
&'life0 mut self,
_fds: Option<ListenFds>,
shutdown: ShutdownWatch,
_listeners_per_fd: usize,
ready: ServiceReadyNotifier,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
This function will be called when the server is ready to start the service. Read more
Source§fn name(&self) -> &str
fn name(&self) -> &str
The name of the service, just for logging and naming the threads assigned to this service Read more
Source§fn threads(&self) -> Option<usize>
fn threads(&self) -> Option<usize>
The preferred number of threads to run this service Read more
Source§fn on_startup_delay(&self, time_waited: Duration)
fn on_startup_delay(&self, time_waited: Duration)
This is currently called to inform the service about the delay it
experienced from between waiting on its dependencies. Default behavior
is to log the time. Read more
Auto Trait Implementations§
impl<A> Freeze for GenBackgroundService<A>
impl<A> RefUnwindSafe for GenBackgroundService<A>where
A: RefUnwindSafe,
impl<A> Send for GenBackgroundService<A>
impl<A> Sync for GenBackgroundService<A>
impl<A> Unpin for GenBackgroundService<A>
impl<A> UnsafeUnpin for GenBackgroundService<A>
impl<A> UnwindSafe for GenBackgroundService<A>where
A: RefUnwindSafe,
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