roma-glushko / notifykit

👀 A performant, cross-platform, modern Pythonic toolkit for building applications that need watching filesystem events
https://notifykit.readthedocs.io/en/latest/
Apache License 2.0
8 stars 1 forks source link

Listen to events via I/O multiplexing #4

Open roma-glushko opened 1 year ago

roma-glushko commented 1 year ago

We are using sync approach to listening to events which works but there is one caveat. We had to interrupt after some time to see if we had not received a termination signal yet:

https://github.com/roma-glushko/inotifykit/blob/e3097ce41826908ec8f33c51c5b27afb33f02567/src/lib.rs#L38

So essentially, we are polling signal info instead of being notified when it happened.

Let's try to explore asynchronous approach to event watching/signal handling to save even more CPU cycles.