From 34f528a3b4063b4a25915e60d7f22ee1fb2d1bd9 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Tue, 28 May 2024 15:14:34 +0200 Subject: jsonrpc: add comments & remove debugging code --- jsonrpc/src/client/builder.rs | 3 ++- jsonrpc/src/client/mod.rs | 10 +--------- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'jsonrpc/src/client') diff --git a/jsonrpc/src/client/builder.rs b/jsonrpc/src/client/builder.rs index 4bfb5c3..a287070 100644 --- a/jsonrpc/src/client/builder.rs +++ b/jsonrpc/src/client/builder.rs @@ -50,7 +50,8 @@ pub struct ClientBuilder { } impl ClientBuilder { - /// Set timeout for sending and receiving messages, in milliseconds. + /// Set timeout for receiving messages, in milliseconds. Requests will + /// fail if it takes longer. /// /// # Examples /// diff --git a/jsonrpc/src/client/mod.rs b/jsonrpc/src/client/mod.rs index 05479f9..326252a 100644 --- a/jsonrpc/src/client/mod.rs +++ b/jsonrpc/src/client/mod.rs @@ -98,15 +98,7 @@ impl Client { let req_json = serde_json::to_value(&request)?; - match self.timeout { - Some(ms) => { - let t = Duration::from_millis(ms); - timeout(t, self.conn.send(req_json)).await??; - } - None => { - self.conn.send(req_json).await?; - } - } + self.conn.send(req_json).await?; let (tx, rx) = async_channel::bounded(CHANNEL_CAP); self.chans.lock().await.insert(id, tx); -- cgit v1.2.3