Skip to main content

TwoPhaseClient

Trait TwoPhaseClient 

Source
pub trait TwoPhaseClient: KeyedClient {
    // Required methods
    fn prepare_keyed(
        &self,
        tx_id: Vec<u8>,
        key: Vec<u8>,
        command: Vec<u8>,
    ) -> impl Future<Output = Result<Vec<u8>, ClientError>> + Send;
    fn commit_keyed(
        &self,
        tx_id: Vec<u8>,
        key: Vec<u8>,
    ) -> impl Future<Output = Result<Vec<u8>, ClientError>> + Send;
    fn abort_keyed(
        &self,
        tx_id: Vec<u8>,
        key: Vec<u8>,
    ) -> impl Future<Output = Result<Vec<u8>, ClientError>> + Send;
}
Expand description

Extension of KeyedClient for limited cross-shard 2PC.

Required Methods§

Source

fn prepare_keyed( &self, tx_id: Vec<u8>, key: Vec<u8>, command: Vec<u8>, ) -> impl Future<Output = Result<Vec<u8>, ClientError>> + Send

Stage a command on the shard for key under tx_id.

Source

fn commit_keyed( &self, tx_id: Vec<u8>, key: Vec<u8>, ) -> impl Future<Output = Result<Vec<u8>, ClientError>> + Send

Commit a previously prepared command.

Source

fn abort_keyed( &self, tx_id: Vec<u8>, key: Vec<u8>, ) -> impl Future<Output = Result<Vec<u8>, ClientError>> + Send

Abort a prepared command and release staging state.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§