Open finnito opened 3 years ago
I have not yet run into this problem myself, but looking at the implementation of Monitor.start()
, I think the only way to solve this problem is to remove the call to signal()
completely. IMHO, there is no reason to set up a signal handler there. A monitor can be stopped by calling fsw_stop_monitor()
from another thread so the signal handler (or an appropriate except KeyboardInterrupt:
) can be installed on the main thread.
I also ran into the problem. I'm currently using this subclass of Monitor
, to solve the problem:
class _Monitor(fswatch.Monitor):
def start(self):
fswatch.libfswatch.fsw_start_monitor(self.handle)
Kia ora!
Thanks for the great wrapper. I am attempting to use
fswatch
andtkinter
to monitor the filesystem and display a GUI of changes. The trickiness is thatmonitor.start()
andwindow.mainloop()
(from TK) are both blocking calls. The TKmainloop
is also not threadsafe, and must be run from the main thread. Therefore, I am trying to use fswatch from a thread.I am trying to do essentially this, where the
boot()
function callsmonitor.start()
, but it then crashes, raising the following exception.I'm not super good at this stuff, so any help would be appreciated!