pub trait PeriodicTask: Send + 'static {
// Required method
fn tick(&mut self) -> impl Future<Output = Result<(), TickError>> + Send;
// Provided method
fn shutdown(&mut self) -> impl Future<Output = Result<(), TickError>> + Send { ... }
}Available on crate feature
concurrency only.Expand description
A task that runs on a fixed interval.
Implementations may hold mutable state – tick takes &mut self.
Replies / outputs propagate through the state itself (AtomicU64
counters, ArcSwap<T> config handles, etc.) – tick returns
Result<(), TickError> purely for error signalling.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".