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
7 stars 1 forks source link

[Design] Cross-platform Event API #5

Open roma-glushko opened 10 months ago

roma-glushko commented 10 months ago

Event though we are using notify-rs (that supports inotify-like watches across various platforms like macOS, Linux, Windows, etc) library in inotifykit, it's still tricky to get fully cross-platform API.

The problem is in events/information that different platform support. For example,

Because of this discrepancies in how events are dispatched, it still requires some work to smooth that experience to make it resemble a real platform-agnostic API.

It would be great to put that heavy-lifting on inotifykit, so our users could really focus on their business logic.

Solution

It seems like a way to go is to find a common ground between all supported file watcher's API and unify it on the library level.

One ramification of this is that we would need to hide some of the events or information that is not widely supported by all watchers. it seems like a reasonable limitation as if you had an access to that information, it would be impossible to run that code on the platform that didn't support it (so we would break our cross-platform promise).

This behavior should be optional, so people that needs missing info and don't need true cross-platform support would be able to have that.