From 75008201c2ba4d1c122972df3b0d3eb3675421e6 Mon Sep 17 00:00:00 2001 From: Allan Clements Date: Tue, 24 Sep 2024 10:56:44 -0500 Subject: [PATCH] Removed internal channel bounding --- gremlin-client/src/aio/connection.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gremlin-client/src/aio/connection.rs b/gremlin-client/src/aio/connection.rs index 6fae0eb7..f439348c 100644 --- a/gremlin-client/src/aio/connection.rs +++ b/gremlin-client/src/aio/connection.rs @@ -41,7 +41,9 @@ use futures::{ SinkExt, StreamExt, }; -use futures::channel::mpsc::{channel, Receiver, Sender}; +use futures::channel::mpsc::{ + channel, unbounded, Receiver, Sender, UnboundedReceiver, UnboundedSender, +}; use std::collections::HashMap; use std::sync::atomic::{self, AtomicBool}; use std::sync::Arc; @@ -64,7 +66,7 @@ pub enum Cmd { } pub(crate) struct Conn { - sender: Sender, + sender: UnboundedSender, valid: Arc, connection_uuid: Uuid, } @@ -166,7 +168,7 @@ impl Conn { info!("{connection_uuid} Opened websocket connection"); let (sink, stream) = client.split(); - let (sender, receiver) = channel(20); + let (sender, receiver) = unbounded(); let requests = Arc::new(Mutex::new(HashMap::new())); sender_loop(connection_uuid.clone(), sink, requests.clone(), receiver); @@ -236,7 +238,7 @@ fn sender_loop( connection_uuid: Uuid, mut sink: SplitSink, requests: Arc>>>>, - mut receiver: Receiver, + mut receiver: UnboundedReceiver, ) { task::spawn(async move { loop { @@ -282,7 +284,7 @@ fn receiver_loop( connection_uuid: Uuid, mut stream: SplitStream, requests: Arc>>>>, - mut sender: Sender, + mut sender: UnboundedSender, connection_valid_flag: Arc, ) { task::spawn(async move {