Skip to content

A futures friendly inotify wrapper for fibers crate

License

Notifications You must be signed in to change notification settings

sile/fibers_inotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fibers_inotify

fibers_inotify Documentation Build Status Code Coverage License: MIT

A futures friendly inotify wrapper for fibers crate.

Documentation.

Examples

Watches /tmp directory:

use fibers::{Executor, InPlaceExecutor, Spawn};
use fibers_inotify::{InotifyService, WatchMask};
use futures::{Future, Stream};

let inotify_service = InotifyService::new();
let inotify_handle = inotify_service.handle();

let mut executor = InPlaceExecutor::new().unwrap();
executor.spawn(inotify_service.map_err(|e| panic!("{}", e)));

let fiber = executor.spawn_monitor(
   inotify_handle
       .watch("/tmp/", WatchMask::CREATE | WatchMask::DELETE)
       .for_each(|event| Ok(println!("# EVENT: {:?}", event)))
       .map_err(|e| panic!("{}", e)),
   );

let _ = executor.run_fiber(fiber).unwrap();

About

A futures friendly inotify wrapper for fibers crate

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages