From 0bb7cdf696190200d1885ec822518ac45b685a9b Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 15 Feb 2024 11:04:10 +0100 Subject: [PATCH] Set pipelinable commands to 64 --- src/imap/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/imap/mod.rs b/src/imap/mod.rs index 6f143d7..58c4dc0 100644 --- a/src/imap/mod.rs +++ b/src/imap/mod.rs @@ -142,6 +142,8 @@ use tokio::sync::mpsc::*; use tokio::sync::Notify; use tokio_util::bytes::BytesMut; +const PIPELINABLE_COMMANDS: usize = 64; + #[derive(Debug)] enum LoopMode { Quit, @@ -201,7 +203,7 @@ impl NetLoop { .await?; // Start a mailbox session in background - let (cmd_tx, cmd_rx) = mpsc::channel::(3); + let (cmd_tx, cmd_rx) = mpsc::channel::(PIPELINABLE_COMMANDS); let (resp_tx, resp_rx) = mpsc::unbounded_channel::(); tokio::spawn(Self::session(ctx.clone(), cmd_rx, resp_tx));