Open wosc opened 5 years ago
Neat, thanks for this!
Alternatives do exist, e.g. watchdog was mentioned in a previous issue comment, that uses inotify on Linux and FSEvents on macOS. However, its API is thread-based, and I have no idea how that could be integrated with asyncio, or whether that's even possible.
Hmm, I haven't hacked on asyncio Python in a while, but I think we could get this to work. Will investigate.
See issue #10 for more details. I've tested this under both Linux and macOS, and it worked fine for me.
Note that watchgod (isn't that name cute ;) does not use inotify/fsevents but file polling instead. I don't think the performance implications are terrible, but I admit it's not as pleasing to my nerd-sense of elegance.
My main reason for chosing it is that it offers an asyncio-compatible API, so it was really easy to integrate. Alternatives do exist, e.g. watchdog was mentioned in a previous issue comment, that uses inotify on Linux and FSEvents on macOS. However, its API is thread-based, and I have no idea how that could be integrated with asyncio, or whether that's even possible.