Struct garage_rpc::rpc_helper::RpcHelper
source · pub struct RpcHelper(_);
Implementations§
source§impl RpcHelper
impl RpcHelper
pub fn rpc_timeout(&self) -> Duration
pub async fn call<M, N, H, S>(
&self,
endpoint: &Endpoint<M, H>,
to: Uuid,
msg: N,
strat: RequestStrategy
) -> Result<S, Error>where
M: Rpc<Response = Result<S, Error>>,
N: IntoReq<M> + Send,
H: StreamingEndpointHandler<M>,
pub async fn call_many<M, N, H, S>(
&self,
endpoint: &Endpoint<M, H>,
to: &[Uuid],
msg: N,
strat: RequestStrategy
) -> Result<Vec<(Uuid, Result<S, Error>)>, Error>where
M: Rpc<Response = Result<S, Error>>,
N: IntoReq<M>,
H: StreamingEndpointHandler<M>,
pub async fn broadcast<M, N, H, S>(
&self,
endpoint: &Endpoint<M, H>,
msg: N,
strat: RequestStrategy
) -> Result<Vec<(Uuid, Result<S, Error>)>, Error>where
M: Rpc<Response = Result<S, Error>>,
N: IntoReq<M>,
H: StreamingEndpointHandler<M>,
sourcepub async fn try_call_many<M, N, H, S>(
&self,
endpoint: &Arc<Endpoint<M, H>>,
to: &[Uuid],
msg: N,
strategy: RequestStrategy
) -> Result<Vec<S>, Error>where
M: Rpc<Response = Result<S, Error>> + 'static,
N: IntoReq<M>,
H: StreamingEndpointHandler<M> + 'static,
S: Send + 'static,
pub async fn try_call_many<M, N, H, S>(
&self,
endpoint: &Arc<Endpoint<M, H>>,
to: &[Uuid],
msg: N,
strategy: RequestStrategy
) -> Result<Vec<S>, Error>where
M: Rpc<Response = Result<S, Error>> + 'static,
N: IntoReq<M>,
H: StreamingEndpointHandler<M> + 'static,
S: Send + 'static,
Make a RPC call to multiple servers, returning either a Vec of responses, or an error if quorum could not be reached due to too many errors