fix: increase channels buffer size

maybe helps? idk probably not actually
This commit is contained in:
əlemi 2024-02-07 21:24:31 +01:00
parent ed1ce45e7f
commit 99a268185a
2 changed files with 2 additions and 2 deletions

View file

@ -112,7 +112,7 @@ impl Client {
pub async fn join_workspace(&mut self, workspace: &str) -> crate::Result<Arc<Workspace>> { pub async fn join_workspace(&mut self, workspace: &str) -> crate::Result<Arc<Workspace>> {
let ws_stream = self.services.workspace.clone().attach(Empty{}.into_request()).await?.into_inner(); let ws_stream = self.services.workspace.clone().attach(Empty{}.into_request()).await?.into_inner();
let (tx, rx) = mpsc::channel(10); let (tx, rx) = mpsc::channel(256);
let cur_stream = self.services.cursor.clone() let cur_stream = self.services.cursor.clone()
.attach(tokio_stream::wrappers::ReceiverStream::new(rx)) .attach(tokio_stream::wrappers::ReceiverStream::new(rx))
.await? .await?

View file

@ -94,7 +94,7 @@ impl Workspace {
let credentials = worskspace_client.access_buffer(request).await?.into_inner(); let credentials = worskspace_client.access_buffer(request).await?.into_inner();
self.token.send(credentials.token)?; self.token.send(credentials.token)?;
let (tx, rx) = mpsc::channel(10); let (tx, rx) = mpsc::channel(256);
let mut req = tonic::Request::new(tokio_stream::wrappers::ReceiverStream::new(rx)); let mut req = tonic::Request::new(tokio_stream::wrappers::ReceiverStream::new(rx));
req.metadata_mut().insert("path", tonic::metadata::MetadataValue::try_from(credentials.id.id).expect("could not represent path as byte sequence")); req.metadata_mut().insert("path", tonic::metadata::MetadataValue::try_from(credentials.id.id).expect("could not represent path as byte sequence"));
let stream = self.services.buffer.clone().attach(req).await?.into_inner(); let stream = self.services.buffer.clone().attach(req).await?.into_inner();