aboutsummaryrefslogtreecommitdiff
path: root/jsonrpc/src/client/subscriber.rs
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-06-14 22:49:53 +0200
committerhozan23 <hozan23@karyontech.net>2024-06-14 22:49:53 +0200
commit3429caa87699d986f799a11f6e0f4526e723b655 (patch)
treee548c356fca4eb76742e29d4bab05007468ed14b /jsonrpc/src/client/subscriber.rs
parent0c0699c0460c1b149915729223eec701bde481df (diff)
jsonrpc: client use unbounded channels as buffer for sending requests & clean up examples
Diffstat (limited to 'jsonrpc/src/client/subscriber.rs')
-rw-r--r--jsonrpc/src/client/subscriber.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/jsonrpc/src/client/subscriber.rs b/jsonrpc/src/client/subscriber.rs
index d47cc2a..168f16e 100644
--- a/jsonrpc/src/client/subscriber.rs
+++ b/jsonrpc/src/client/subscriber.rs
@@ -11,8 +11,6 @@ use crate::{
Error, Result,
};
-const CHANNEL_CAP: usize = 10;
-
/// Manages subscriptions for the client.
pub(super) struct Subscriber {
subs: Mutex<HashMap<SubscriptionID, Sender<serde_json::Value>>>,
@@ -31,7 +29,7 @@ impl Subscriber {
}
pub(super) async fn subscribe(&self, id: SubscriptionID) -> Receiver<serde_json::Value> {
- let (ch_tx, ch_rx) = async_channel::bounded(CHANNEL_CAP);
+ let (ch_tx, ch_rx) = async_channel::unbounded();
self.subs.lock().await.insert(id, ch_tx);
ch_rx
}