Skip to main content

ShardRpcDispatch

Trait ShardRpcDispatch 

Source
pub trait ShardRpcDispatch:
    Send
    + Sync
    + 'static {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        req: VShardEnvelope,
        timeout_ms: u64,
    ) -> Pin<Box<dyn Future<Output = Result<VShardEnvelope>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Send one request envelope to a shard and await one response envelope.

Implementors are responsible for:

  • Routing the envelope to the correct peer (local loopback or QUIC).
  • Applying per-call timeouts (the caller sets timeout_ms in FanOutParams; the implementor enforces it).
  • Returning Err on transport failure so the coordinator can propagate the error rather than silently dropping the shard.

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, req: VShardEnvelope, timeout_ms: u64, ) -> Pin<Box<dyn Future<Output = Result<VShardEnvelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send req to the shard identified by req.vshard_id and return the shard’s response envelope.

Implementors§