ParallelFetch

Trait ParallelFetch 

Source
pub trait ParallelFetch:
    Send
    + Sync
    + 'static {
    type Output: Send + 'static;

    // Required method
    fn fetch(
        &self,
        conn: ConnectionManager,
        keys: Vec<String>,
    ) -> impl Future<Output = Result<Vec<Self::Output>>> + Send;
}
Expand description

Trait for types that can be fetched in parallel.

Implementors define how to fetch a batch of keys from Redis.

Required Associated Types§

Source

type Output: Send + 'static

The output type for each fetched item.

Required Methods§

Source

fn fetch( &self, conn: ConnectionManager, keys: Vec<String>, ) -> impl Future<Output = Result<Vec<Self::Output>>> + Send

Fetch data for the given keys.

This is called by worker tasks and should be efficient for batch operations.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§