pub struct StoragePersistSink { /* private fields */ }Expand description
SpectraSink that queues telemetry for asynchronous storage through a SpectraRouter.
Queue capacity and batching are configured with PersistConfig (via
crate::SpectraBuilder::persist), not environment variables.
Default overflow policy is PersistOverflow::Drop (non-blocking; drops counted via
persist_queue_drops). Use PersistOverflow::Block for backpressure.
Call PersistHandle::flush (or crate::Spectra::flush_persist) to wait for durability.
Implementations§
Source§impl StoragePersistSink
impl StoragePersistSink
Sourcepub fn new(router: Arc<SpectraRouter>) -> Self
pub fn new(router: Arc<SpectraRouter>) -> Self
Persist-only sink with default PersistConfig.
Sourcepub fn new_with_config(
router: Arc<SpectraRouter>,
config: PersistConfig,
) -> Self
pub fn new_with_config( router: Arc<SpectraRouter>, config: PersistConfig, ) -> Self
Persist-only sink with explicit config.
Sourcepub fn with_inner(
router: Arc<SpectraRouter>,
inner: Option<Arc<dyn SpectraSink>>,
) -> Self
pub fn with_inner( router: Arc<SpectraRouter>, inner: Option<Arc<dyn SpectraSink>>, ) -> Self
Invoke inner on the hot path, then enqueue the same emit for async storage persist.
Sourcepub fn with_config(
router: Arc<SpectraRouter>,
inner: Option<Arc<dyn SpectraSink>>,
config: PersistConfig,
) -> Self
pub fn with_config( router: Arc<SpectraRouter>, inner: Option<Arc<dyn SpectraSink>>, config: PersistConfig, ) -> Self
Like Self::with_inner with explicit PersistConfig.
Sourcepub fn handle(&self) -> PersistHandle
pub fn handle(&self) -> PersistHandle
Handle for PersistHandle::flush.
Trait Implementations§
Source§impl SpectraSink for StoragePersistSink
impl SpectraSink for StoragePersistSink
Auto Trait Implementations§
impl !RefUnwindSafe for StoragePersistSink
impl !UnwindSafe for StoragePersistSink
impl Freeze for StoragePersistSink
impl Send for StoragePersistSink
impl Sync for StoragePersistSink
impl Unpin for StoragePersistSink
impl UnsafeUnpin for StoragePersistSink
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