[Twisted-Python] Is it necessary to create a new reactor to daemonize a File Alteration Monitoring system

Hello, I manage to write a file system monitoring daemon based on gamin ( http://gnome.org/~veillard/gamin/) thanks to twisted API. Therefore I have created a new reactor, which inherit from the ReactorBase. In order to use the twistd application runner I have a GaminService which define a simple StartService. Am I in the good way ? The code is in attachment -- Olivier Guilloux

Kaladan wrote:
Creating a new reactor is a horrible way to do that. I guess you should either 1) use get_fd(), an existing reactor and handle_events() to talk to gamin in a non-blocking way (and if that proves impossible, work on improving the gamin client side library or python bindings so that it becomes possible) (plug the result of get_fd() as a readable fd in a reactor, whenever it is readable, call handle_events(); the web docs don't explain if non-blocking add of watchers is supported or not) OR 2) reimplement the gamin client protocol from scratch with twisted.

Kaladan wrote:
Creating a new reactor is a horrible way to do that. I guess you should either 1) use get_fd(), an existing reactor and handle_events() to talk to gamin in a non-blocking way (and if that proves impossible, work on improving the gamin client side library or python bindings so that it becomes possible) (plug the result of get_fd() as a readable fd in a reactor, whenever it is readable, call handle_events(); the web docs don't explain if non-blocking add of watchers is supported or not) OR 2) reimplement the gamin client protocol from scratch with twisted.
participants (2)
-
Kaladan
-
Tommi Virtanen