From c8906f200bf907272bf9fba7d183df4332fa085b Mon Sep 17 00:00:00 2001 From: Trinity Pointard Date: Tue, 6 Apr 2021 05:25:28 +0200 Subject: make most requested changes --- src/rpc/rpc_client.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/rpc/rpc_client.rs') 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 RpcClient { self.local_handler.swap(Some(Arc::new((my_id, handler)))); } - /// Get the server address this client connect to - pub fn get_addr(&self) -> &RpcAddrClient { + /// Get a RPC client to make calls using node's SocketAddr instead of its ID + pub fn by_addr(&self) -> &RpcAddrClient { &self.rpc_addr_client } @@ -167,7 +168,7 @@ impl RpcClient { } /// 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, to: &[UUID], @@ -227,7 +228,7 @@ impl RpcClient { } } -/// Endpoint to which send RPC +/// Thin wrapper arround an `RpcHttpClient` specifying the path of the request pub struct RpcAddrClient { phantom: PhantomData, -- cgit v1.2.3