WebFreak001 / FSWatch

A cross-platform folder & file watching library using win32, inotify or std.file
33 stars 8 forks source link

Is getEvents() a blocking read? #14

Closed russel closed 6 years ago

russel commented 6 years ago

If it is then doesn't there need to be a version with a timeout?

If I have a thread running a watcher and getEvents() blocks, then it is not possible to terminate the thread and so terminate the application.

DInotify added the read(Duration) function to deal with this.

russel commented 6 years ago

I misunderstood, getEvents is a poll.

WebFreak001 commented 6 years ago

yeah this is rather meant for game style main loops and not event loops

russel commented 6 years ago

Sadly I am also finding that it is not reliable at reporting events when using INotify on Debian Sid looking for /dev/dvb tree events. I have DInotify working fine, albeit in an overcomplicated way that I shall now simplify, but was looking to replace with something cross platform analogous to Rust's Notify, and then get stuff working properly on OSX/macOS. However, I think I'll have to go back to the DInotify solution rewritten, at least for now.