Skip to content

Commit

Permalink
Use PollWatcher in memofs StdBackend
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethloeffler committed Sep 17, 2023
1 parent e11ad47 commit 116263a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/memofs/src/std_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ use std::thread;
use std::time::Duration;

use crossbeam_channel::Receiver;
use notify::{watcher, DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher};
use notify::{DebouncedEvent, PollWatcher, RecursiveMode, Watcher};

use crate::{DirEntry, Metadata, ReadDir, VfsBackend, VfsEvent};

/// `VfsBackend` that uses `std::fs` and the `notify` crate.
pub struct StdBackend {
watcher: RecommendedWatcher,
watcher: PollWatcher,
watcher_receiver: Receiver<VfsEvent>,
}

impl StdBackend {
pub fn new() -> StdBackend {
let (notify_tx, notify_rx) = mpsc::channel();
let watcher = watcher(notify_tx, Duration::from_millis(50)).unwrap();
let watcher = PollWatcher::new(notify_tx, Duration::from_millis(50)).unwrap();

let (tx, rx) = crossbeam_channel::unbounded();

Expand Down

0 comments on commit 116263a

Please sign in to comment.