Skip to content

Commit 5859eaa

Browse files
committed
chore: rename BatchEvents to EventBatch
1 parent ca6fad4 commit 5859eaa

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

crates/rspack_fs/src/watcher/executor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use tokio::sync::{
1010
};
1111

1212
use super::{EventAggregateHandler, EventHandler, FsEventKind};
13-
use crate::watcher::BatchEvents;
13+
use crate::watcher::EventBatch;
1414

1515
type ThreadSafetyReceiver<T> = ThreadSafety<UnboundedReceiver<T>>;
1616
type ThreadSafety<T> = Arc<Mutex<T>>;
@@ -33,7 +33,7 @@ impl FilesData {
3333
/// deleted files, and coordinates the event handling logic.
3434
pub struct Executor {
3535
aggregate_timeout: u32,
36-
rx: ThreadSafetyReceiver<BatchEvents>,
36+
rx: ThreadSafetyReceiver<EventBatch>,
3737
files_data: ThreadSafety<FilesData>,
3838
exec_aggregate_tx: UnboundedSender<ExecAggregateEvent>,
3939
exec_aggregate_rx: ThreadSafetyReceiver<ExecAggregateEvent>,
@@ -60,13 +60,13 @@ enum ExecAggregateEvent {
6060
}
6161

6262
enum ExecEvent {
63-
Execute(BatchEvents),
63+
Execute(EventBatch),
6464
Close,
6565
}
6666

6767
impl Executor {
6868
/// Create a new `WatcherExecutor` with the given receiver and optional aggregate timeout.
69-
pub fn new(rx: UnboundedReceiver<BatchEvents>, aggregate_timeout: Option<u32>) -> Self {
69+
pub fn new(rx: UnboundedReceiver<EventBatch>, aggregate_timeout: Option<u32>) -> Self {
7070
let (exec_aggregate_tx, exec_aggregate_rx) = mpsc::unbounded_channel::<ExecAggregateEvent>();
7171
let (exec_tx, exec_rx) = mpsc::unbounded_channel::<ExecEvent>();
7272

crates/rspack_fs/src/watcher/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub(crate) struct FsEvent {
3939
pub kind: FsEventKind,
4040
}
4141

42-
pub(crate) type BatchEvents = Vec<FsEvent>;
42+
pub(crate) type EventBatch = Vec<FsEvent>;
4343

4444
/// `EventAggregateHandler` is a trait for handling aggregated file system events.
4545
/// It provides methods to handle changes and deletions of files, as well as errors.

crates/rspack_fs/src/watcher/scanner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ use std::{ops::Deref, sync::Arc};
33
use tokio::sync::mpsc::UnboundedSender;
44

55
use super::{FsEvent, FsEventKind, PathManager};
6-
use crate::watcher::BatchEvents;
6+
use crate::watcher::EventBatch;
77

88
// Scanner will scann the path whether it is exist or not in disk on initialization
99
pub struct Scanner {
1010
path_manager: Arc<PathManager>,
11-
tx: Option<UnboundedSender<BatchEvents>>,
11+
tx: Option<UnboundedSender<EventBatch>>,
1212
}
1313

1414
impl Scanner {
1515
/// Creates a new `Scanner` that will send events to the provided sender when paths are scanned.
16-
pub fn new(tx: UnboundedSender<BatchEvents>, path_manager: Arc<PathManager>) -> Self {
16+
pub fn new(tx: UnboundedSender<EventBatch>, path_manager: Arc<PathManager>) -> Self {
1717
Self {
1818
path_manager,
1919
tx: Some(tx),

crates/rspack_fs/src/watcher/trigger.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rspack_paths::ArcPath;
55
use tokio::sync::mpsc::UnboundedSender;
66

77
use super::{FsEvent, FsEventKind};
8-
use crate::watcher::{BatchEvents, paths::PathManager};
8+
use crate::watcher::{EventBatch, paths::PathManager};
99
/// `DependencyFinder` provides references to sets of files, directories, and missing paths,
1010
/// allowing efficient lookup and dependency resolution for a given path.
1111
///
@@ -91,12 +91,12 @@ pub struct Trigger {
9191
/// Shared reference to the path register, which tracks watched files/directories/missing.
9292
path_manager: Arc<PathManager>,
9393
/// Sender for communicating file system events to the watcher executor.
94-
tx: UnboundedSender<BatchEvents>,
94+
tx: UnboundedSender<EventBatch>,
9595
}
9696

9797
impl Trigger {
9898
/// Create a new `Trigger` with the given path register and event sender.
99-
pub fn new(path_manager: Arc<PathManager>, tx: UnboundedSender<BatchEvents>) -> Self {
99+
pub fn new(path_manager: Arc<PathManager>, tx: UnboundedSender<EventBatch>) -> Self {
100100
Self { path_manager, tx }
101101
}
102102

0 commit comments

Comments
 (0)