pub struct SimpleServiceTask { /* private fields */ }Trait Implementations§
Source§impl BackgroundService for SimpleServiceTask
impl BackgroundService for SimpleServiceTask
Source§fn start<'life0, 'async_trait>(
&'life0 self,
shutdown: ShutdownWatch,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
shutdown: ShutdownWatch,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts the background service, executing all tasks at the specified interval until shutdown is signaled or tasks complete. Each task execution is logged with timing information and success/failure status.
§Arguments
shutdown- Watch channel for shutdown coordination
§Task Execution
- Tasks are executed sequentially in the order they were added
- Each task receives a counter value that increments with each interval
- Failed tasks are logged with error details but don’t stop the service
- Task execution times are logged for monitoring purposes
§Shutdown Behavior
- Service stops gracefully when shutdown signal is received
- Current task iteration completes before shutdown
Auto Trait Implementations§
impl !Freeze for SimpleServiceTask
impl !RefUnwindSafe for SimpleServiceTask
impl Send for SimpleServiceTask
impl Sync for SimpleServiceTask
impl Unpin for SimpleServiceTask
impl !UnwindSafe for SimpleServiceTask
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