pub struct MetricsWorker { /* private fields */ }Expand description
Worker that consumes metrics events from the bus and writes them to storage
Implementations§
Source§impl MetricsWorker
impl MetricsWorker
Sourcepub fn new(storage: Arc<dyn MetricsStorage>) -> Self
pub fn new(storage: Arc<dyn MetricsStorage>) -> Self
Create a new metrics worker with the given storage backend
Sourcepub fn spawn(
&self,
receiver: Receiver<MetricsEvent>,
bus: MetricsBus,
) -> Arc<AtomicBool>
pub fn spawn( &self, receiver: Receiver<MetricsEvent>, bus: MetricsBus, ) -> Arc<AtomicBool>
Spawn the worker task
Returns a handle to stop the worker
Auto Trait Implementations§
impl Freeze for MetricsWorker
impl !RefUnwindSafe for MetricsWorker
impl Send for MetricsWorker
impl Sync for MetricsWorker
impl Unpin for MetricsWorker
impl UnsafeUnpin for MetricsWorker
impl !UnwindSafe for MetricsWorker
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