henrikbjorn/Lurker — pull request #8 by romainneutron (2013-12-23 15:16:06+00:00)
Title: Add ResourceWatcherEvent

Hey,

this PR adds `ResourceWatcherEvent` providing three events type to interact with the ResourceWatcher itself.
It can be very convenient in some case to know when a period has been finished.

For example, if listening to the events in a directory :
- I considering a created / modified file as "hot"
- I wait 10 seconds on a hot file to consider it "cold". If a modification occurs within the 10 seconds, it's still "hot". When it's "cold", I can process it safely (FTP files being written can take long time if the client disconnects then resumes)
- Once the 10 seconds are over, I process it.

With the current implementation, if nothing changes in the directory, there are no events. We have to run `ResourceWatcher::start` with a time limit , then process files, then re-run etc...

With this PR, this kind of usecase is doable out of the box.