diff options
author | hozan23 <hozan23@karyontech.net> | 2024-06-14 22:49:53 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-06-14 22:49:53 +0200 |
commit | 3429caa87699d986f799a11f6e0f4526e723b655 (patch) | |
tree | e548c356fca4eb76742e29d4bab05007468ed14b /jsonrpc/src/client/subscriber.rs | |
parent | 0c0699c0460c1b149915729223eec701bde481df (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.rs | 4 |
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 } |