The module pyfsevents allows Python programs to utilize the Mac OS X FSEvents framework. One can register a path and a callback function, then call the listen() function, which blocks until a file system event happens in the registered path.
pyfsevents.registerpath("/example", callback)
pyfsevents.listen()
I would like to use this module in a multithreaded program, having one thread blocking and waiting for file system events, then notifying another thread to handle the event. Unfortunately, it looks like listen() blocks the entire program, not just the calling thread. Can anyone confirm this? Is there a way to block only the calling thread? If not, are there ways to achieve similar functionality, i.e. letting a thread detect changes in a directory, preferably without polling?