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_msinFanOutParams; the implementor enforces it). - Returning
Erron transport failure so the coordinator can propagate the error rather than silently dropping the shard.
Required Methods§
Sourcefn 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,
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.