Skip to main content

GroupStore

Trait GroupStore 

Source
pub trait GroupStore: Send + Sync {
    // Required methods
    fn append(&self, key: &str, msg: Message) -> (Vec<Message>, Instant);
    fn take(&self, key: &str) -> Option<Vec<Message>>;
    fn clear(&self);
}
Expand description

Pluggable storage for in-progress correlation groups. The default InMemoryGroupStore keeps groups in a Mutex<HashMap>; persistent implementations can plug in via Aggregator::with_store.

Required Methods§

Source

fn append(&self, key: &str, msg: Message) -> (Vec<Message>, Instant)

Append msg to the group keyed by key, returning a snapshot of the group (post-append) and the Instant the group was first seen.

Source

fn take(&self, key: &str) -> Option<Vec<Message>>

Remove and return the group keyed by key. Called once completion fires.

Source

fn clear(&self)

Drop every in-progress group. Primarily a test utility.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§