aboutsummaryrefslogtreecommitdiff
path: root/jsonrpc/src/client
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-05-28 15:14:34 +0200
committerhozan23 <hozan23@karyontech.net>2024-05-28 15:14:34 +0200
commit34f528a3b4063b4a25915e60d7f22ee1fb2d1bd9 (patch)
tree0327af027e72f7baf5f484c79b189aae631773d0 /jsonrpc/src/client
parent9341e695d0e387927804716b60945912cba686dd (diff)
jsonrpc: add comments & remove debugging code
Diffstat (limited to 'jsonrpc/src/client')
-rw-r--r--jsonrpc/src/client/builder.rs3
-rw-r--r--jsonrpc/src/client/mod.rs10
2 files changed, 3 insertions, 10 deletions
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);