aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rpc_client.rs
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-04-06 05:25:28 +0200
committerAlex Auvolat <alex@adnab.me>2021-04-27 16:47:08 +0200
commit74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88 (patch)
treed33d89915de29eb69e1b527c686f26358fcd2b45 /src/rpc/rpc_client.rs
parent16300bbd89235dfb5852413cd451535559664594 (diff)
downloadgarage-74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88.tar.gz
garage-74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88.zip
make most requested changes
Diffstat (limited to 'src/rpc/rpc_client.rs')
-rw-r--r--src/rpc/rpc_client.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rpc/rpc_client.rs b/src/rpc/rpc_client.rs
index 53051cee..8a6cc721 100644
--- a/src/rpc/rpc_client.rs
+++ b/src/rpc/rpc_client.rs
@@ -53,6 +53,7 @@ impl RequestStrategy {
self
}
/// Set if requests can be dropped after quorum has been reached
+ /// In general true for read requests, and false for write
pub fn interrupt_after_quorum(mut self, interrupt: bool) -> Self {
self.rs_interrupt_after_quorum = interrupt;
self
@@ -103,8 +104,8 @@ impl<M: RpcMessage + 'static> RpcClient<M> {
self.local_handler.swap(Some(Arc::new((my_id, handler))));
}
- /// Get the server address this client connect to
- pub fn get_addr(&self) -> &RpcAddrClient<M> {
+ /// Get a RPC client to make calls using node's SocketAddr instead of its ID
+ pub fn by_addr(&self) -> &RpcAddrClient<M> {
&self.rpc_addr_client
}
@@ -166,7 +167,7 @@ impl<M: RpcMessage + 'static> RpcClient<M> {
}
/// Make a RPC call to multiple servers, returning either a Vec of responses, or an error if
- /// strategy could not be respected due to to many errors
+ /// strategy could not be respected due to too many errors
pub async fn try_call_many(
self: &Arc<Self>,
to: &[UUID],
@@ -226,7 +227,7 @@ impl<M: RpcMessage + 'static> RpcClient<M> {
}
}
-/// Endpoint to which send RPC
+/// Thin wrapper arround an `RpcHttpClient` specifying the path of the request
pub struct RpcAddrClient<M: RpcMessage> {
phantom: PhantomData<M>,