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
committerTrinity Pointard <trinity.pointard@gmail.com>2021-04-06 05:28:47 +0200
commitc8906f200bf907272bf9fba7d183df4332fa085b (patch)
tree68aea7345bd95761f016976fbf0c183bee1e7092 /src/rpc/rpc_client.rs
parent653d3d588f912bcf86b24c456f23d6db0ca755d8 (diff)
downloadgarage-c8906f200bf907272bf9fba7d183df4332fa085b.tar.gz
garage-c8906f200bf907272bf9fba7d183df4332fa085b.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 261dec7a..3bb58c91 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
}
@@ -167,7 +168,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],
@@ -227,7 +228,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>,