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 authored and Phoenix500526 committed Apr 28, 2024
1 parent 7e77dbc commit 7432a34
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 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,10 @@ 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
file_iter: flume::IntoIter<LockedFile>,
/// Stopped flag
stopped: Arc<AtomicBool>,
}
Expand Down Expand Up @@ -97,7 +95,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 +141,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 7432a34

Please sign in to comment.