haskell-fswatch / hfsnotify

Unified Haskell interface for basic file system notifications
BSD 3-Clause "New" or "Revised" License
136 stars 40 forks source link

Reuseable WatchManager #33

Open neko-kai opened 11 years ago

neko-kai commented 11 years ago

It would've been quite convenient if WatchManager could be reused after closeManager in the same way as http-conduit's Manager.

UnkindPartition commented 10 years ago

Can you explain why this is useful? Maybe give a code snippet that illustrates your use case?

neko-kai commented 10 years ago

@feuerbach I have a file chooser widget specifying a directory to watch for, right now I'm forced to keep associated WatchManager inside an IORef, and destroy-and-rebuild it each time user changes directory. This can get uglier when multiple threads are involved.

gregwebs commented 10 years ago

I think exbb2 wants to cancel all current watches without closing the manager