Skip to content

Commit

Permalink
add readme for examples and more example comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpr03 committed Jul 17, 2023
1 parent efda404 commit b67cfd1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Examples for notify and the debouncers.

### Notify

- **minitor_raw** basic example for using notify
- **async_monitor** example for using `futures::channel` to receive events in async code
- **poll_sysfs** example for observing linux `/sys` events using PollWatcher and the hasing mode
- **watcher_kind** example for detecting the kind of watcher used and running specific configurations
- **hot_reload_tide** large example for async notify using the crates tide and async-std
- **pollwatcher_scan** example using `PollWatcher::with_initial_scan` to listen for files found during initial scanning

### Notify Debouncer Full (debouncer)

- **monitor_debounced** basic usage example for the debouncer
- **monitor_full** advanced usage accessing the internal file ID cache

### Debouncer Mini (mini debouncer)

- **debouncer_mini** basic usage example for the mini debouncer
- **debouncer_mini_custom** using the mini debouncer with a specific backend (PollWatcher)
1 change: 1 addition & 0 deletions examples/debouncer_full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use notify::{RecursiveMode, Watcher};
use notify_debouncer_full::new_debouncer;
use tempfile::tempdir;

/// Advanced example of the notify-debouncer-full, accessing the internal file ID cache
fn main() -> Result<(), Box<dyn std::error::Error>> {
let dir = tempdir()?;
let dir_path = dir.path().to_path_buf();
Expand Down
1 change: 1 addition & 0 deletions examples/monitor_debounced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use notify::{RecursiveMode, Watcher};
use notify_debouncer_full::new_debouncer;
use std::{path::Path, time::Duration};

/// Example for notify-debouncer-full
fn main() {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();

Expand Down

0 comments on commit b67cfd1

Please sign in to comment.