Trait mz_service::client::PartitionedState

source ·
pub trait PartitionedState<C, R>: Debug + Send {
    // Required methods
    fn split_command(&mut self, command: C) -> Vec<Option<C>>;
    fn absorb_response(
        &mut self,
        shard_id: usize,
        response: R,
    ) -> Option<Result<R, Error>>;
}
Expand description

A state machine for a partitioned client that partitions commands across and amalgamates responses from multiple partitions.

Required Methods§

source

fn split_command(&mut self, command: C) -> Vec<Option<C>>

Splits a command into multiple partitions.

source

fn absorb_response( &mut self, shard_id: usize, response: R, ) -> Option<Result<R, Error>>

Absorbs a response from a single partition.

If responses from all partitions have been absorbed, returns an amalgamated response.

Implementors§