Struct network::protocols::rpc::OutboundRpcRequest
source · pub struct OutboundRpcRequest {
pub protocol_id: ProtocolId,
pub data: Bytes,
pub res_tx: Sender<Result<Bytes, RpcError>>,
pub timeout: Duration,
}
Expand description
A wrapper struct for an outbound rpc request and its associated context.
Fields§
§protocol_id: ProtocolId
The remote peer’s application module that should handle our outbound rpc request.
For example, if protocol_id == ProtocolId::ConsensusRpc
, then this
outbound rpc request should be handled by the remote peer’s consensus
application module.
data: Bytes
The serialized request data to be sent to the receiver. At this layer in the stack, the request data is just an opaque blob.
res_tx: Sender<Result<Bytes, RpcError>>
Channel over which the rpc response is sent from the rpc layer to the upper client layer.
If there is an error while performing the rpc protocol, e.g., the remote
peer drops the connection, we will send an RpcError
over the channel.
timeout: Duration
The timeout duration for the entire rpc call. If the timeout elapses, the
rpc layer will send an RpcError::TimedOut
error over the
res_tx
channel to the upper client layer.