Improve how `wait_for_delay` option is handled
…cumulate before calling block. Fixes #202 The new algorithm is (pseudocode): loop begin sleep options[:wait_for_delay] # wait for changes to accumulate new_changes = _pop_changes changes += new_changes end until new_changes.empty? unless changes.empty? block.call(changes) end end Note that the "sleep" happens both before and after any callback, so the value of wait_for_delay is effectively doubled. This also means that if the filesystem is constantly changing, the callback will never happen... maybe we should check for this and bail out after, say, 10 seconds even if new changes keep on coming.
Remove signal handling
Preventing finalization on dead actor
When using Calluloid.shutdown there's race condition between listeners and celluloid which in some cases leads to Listener calling #finalize on dead actor. Added a guard that checks if actor is alive when we're exiting from #_wait_for_changes and calls finalizer only if it's alive. PS. I couldn't for a life figure out how to make this test pass. I hate mocking libraries with all my heart. Feel free to fix this. Fixes #197
Remove no longer valid spec that checks trapping of SIGINT
Move trapping of SIGINT to load time.
Listener trapped SIGINT on every instantization. This created problems with overriding SIGINT in client and created issue where only one instance of Listener would be properly finalized leading to a long shutdown + SEGFAULT in some cases. This commit moves singal trapping to Listen module and sets up a trap once at load time, calling Listen.stop which should properly finalize all Listener instances. Additionally information about signal trapping was added to README.md Fixes #194
Fix typo in require statement in CLI
Add README issue about required linux package inotify-tools
- Fix eager loading - Only checked if mtime == current time
Add a listen script to forward events over the network.