pub struct ExactlyOnceRegistry { /* private fields */ }Expand description
Exactly-once processing registry
Implementations§
Source§impl ExactlyOnceRegistry
impl ExactlyOnceRegistry
pub fn new(config: ExactlyOnceConfig) -> Self
Sourcepub fn check_idempotency(&self, key: &str, event_id: Uuid) -> IdempotencyResult
pub fn check_idempotency(&self, key: &str, event_id: Uuid) -> IdempotencyResult
Check and register an idempotency key
Returns New if the key hasn’t been seen (and registers it),
or Duplicate with the original event_id if already processed.
Sourcepub fn commit_offset(
&self,
pipeline_id: &str,
stream_id: &str,
offset: usize,
event_id: Uuid,
)
pub fn commit_offset( &self, pipeline_id: &str, stream_id: &str, offset: usize, event_id: Uuid, )
Commit a consumer offset for a pipeline
Sourcepub fn get_offset(
&self,
pipeline_id: &str,
stream_id: &str,
) -> Option<ConsumerOffset>
pub fn get_offset( &self, pipeline_id: &str, stream_id: &str, ) -> Option<ConsumerOffset>
Get the last committed offset for a pipeline
Sourcepub fn record_processing(&self, pipeline_id: &str, event_id: Uuid)
pub fn record_processing(&self, pipeline_id: &str, event_id: Uuid)
Record that a pipeline has processed an event
Sourcepub fn was_processed(&self, pipeline_id: &str, event_id: Uuid) -> bool
pub fn was_processed(&self, pipeline_id: &str, event_id: Uuid) -> bool
Check if a pipeline has already processed an event
Sourcepub fn stats(&self) -> ExactlyOnceStats
pub fn stats(&self) -> ExactlyOnceStats
Statistics about the exactly-once registry
Auto Trait Implementations§
impl Freeze for ExactlyOnceRegistry
impl !RefUnwindSafe for ExactlyOnceRegistry
impl Send for ExactlyOnceRegistry
impl Sync for ExactlyOnceRegistry
impl Unpin for ExactlyOnceRegistry
impl UnsafeUnpin for ExactlyOnceRegistry
impl UnwindSafe for ExactlyOnceRegistry
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