Skip to content

Commit

Permalink
squash!: update comments
Browse files Browse the repository at this point in the history
Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
  • Loading branch information
bsbds committed Apr 29, 2024
1 parent ff69e2d commit 7060574
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions crates/curp/src/server/storage/wal/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ use std::{

use clippy_utilities::OverflowArithmetic;
use event_listener::Event;
use flume::r#async::RecvStream;
use futures::{FutureExt, StreamExt};
use thiserror::Error;
use tokio::task::JoinHandle;
use tokio_stream::Stream;
use tracing::error;

use super::util::LockedFile;
Expand All @@ -28,8 +24,11 @@ pub(super) struct FilePipeline {
dir: PathBuf,
/// The size of the temp file
file_size: u64,
/// The file receive stream
file_stream: flume::IntoIter<LockedFile>,
/// The file receive iterator
///
/// As tokio::fs is generally slower than std::fs, we use synchronous file allocation.
/// Please also refer to the issue discussed on the tokio repo: https://github.com/tokio-rs/tokio/issues/3664
file_iter: flume::IntoIter<LockedFile>,
/// Stopped flag
stopped: Arc<AtomicBool>,
}
Expand Down Expand Up @@ -97,7 +96,7 @@ impl FilePipeline {
Ok(Self {
dir,
file_size,
file_stream: file_rx.into_iter(),
file_iter: file_rx.into_iter(),
stopped,
})
}
Expand Down Expand Up @@ -143,7 +142,7 @@ impl Iterator for FilePipeline {
if self.stopped.load(Ordering::Relaxed) {
return None;
}
self.file_stream.next().map(Ok)
self.file_iter.next().map(Ok)
}
}

Expand Down

0 comments on commit 7060574

Please sign in to comment.