review: set channel buffer size to 1

Signed-off-by: Yuchen Liang <yuchen@neon.tech>
This commit is contained in:
Yuchen Liang
2024-12-02 16:37:16 +00:00
parent 6a1aa52619
commit 21ca0c4999

View File

@@ -124,7 +124,8 @@ where
where
B: Buffer<IoBuf = Buf> + Send + 'static,
{
let (front, back) = duplex::mpsc::channel(2);
// It is fine to buffer up to only 1 message. We only 1 message in-flight at a time.
let (front, back) = duplex::mpsc::channel(1);
let join_handle = tokio::spawn(async move {
FlushBackgroundTask::new(back, file, gate_guard, ctx)