Skip to main content

EventsBySlicesQuery

Trait EventsBySlicesQuery 

Source
pub trait EventsBySlicesQuery: Send + Sync {
    // Required method
    fn events_by_slices<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entity_type: &'life1 str,
        min_slice: u16,
        max_slice: u16,
        offset: Offset,
        mode: QueryMode,
    ) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<EventEnvelope>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Capability for globally ordered event queries over persistence-id slices.

Slice support is PostgreSQL-first. The fixed slice model is exposed through slice_for and slice_ranges; Cassandra and embedded backends do not implement this capability yet.

Required Methods§

Source

fn events_by_slices<'life0, 'life1, 'async_trait>( &'life0 self, entity_type: &'life1 str, min_slice: u16, max_slice: u16, offset: Offset, mode: QueryMode, ) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<EventEnvelope>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Queries one inclusive slice range for entity_type.

Results follow the backend’s global tag-query ordering contract. PostgreSQL resumes inclusively at the supplied timestamp offset, so exact-position duplicates may be re-emitted and consumers must apply a provider-complete deduplication boundary.

For Live, PostgreSQL holds recent rows behind its configured visibility lag to close the ordinary late-commit race. A transaction open longer than that lag can still commit behind the live cursor and be skipped permanently; size the lag for the deployment’s maximum transaction-duration envelope.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§