brunobord / tdaemon

Test daemon in Python
MIT License
139 stars 44 forks source link

Use Pyinotify instead of busy-polling #2

Open alexbepple opened 14 years ago

alexbepple commented 14 years ago

I think instead of busy-polling every second, the test daemon should listen to Pyinotify, http://trac.dbzteam.org/pyinotify. This is both more efficient and improves the response time to a change. When your tests take less than a second to run, an additional up-to-one-second delay is quite noticeable.

Of course, platform issues have to be considered here. As far as I can tell, the current walking algorithm is platform-independent. Therefore I would suggest to refactor the notification mechanism to a strategy pattern and use Inotify only on Linux.

eugene-eeo commented 9 years ago

Watchdog could be used as well, it provides system dependent notifiers which inevitably boost performance. Tdaemon could be a simple wrapler around it with some fancy notification features based on exit status.