The Listen gem (or our usage of it, same result) is flaky. It fails to start a Listener a third of the time, and occassionally falls back to polling for no known reason.
It seems like it's pretty likely this is going to continue to give us headaches going forward. We should look into alternatives.
The only other Ruby library I'm aware of is Watchr, but it's not maintained. We should either pull that in and patch up the 1.9 compatibility warnings, or look into Java library alternatives. I suspect that a Java alternative would be the most reliable and cross-platform robust, but I think Watchr is pretty simple, so as long as it doesn't resort to polling as it's default mode of operation and takes advantage of platform specific features for file system events, then it might make sense to spike that before going too far down other paths.
Either way this only impacts a version small portion of Doubleshot as a whole, in a single file, so it shouldn't be a huge effort.
Apache has at least a couple different packages for a File System Monitor. One I've seen used in JCI that appears to be non-recursive (which would be annoying as we'd have to glob for subdirectories first), and this one I haven't really looked at yet: http://commons.apache.org/io/api-2.4/org/apache/commons/io/monitor/package-summary.html
If we go down the JAR route, it'd probably be worth polling irc.freenode.net#jruby and see if anyone has any suggestions/experience to offer.
The Listen gem (or our usage of it, same result) is flaky. It fails to start a Listener a third of the time, and occassionally falls back to polling for no known reason.
It seems like it's pretty likely this is going to continue to give us headaches going forward. We should look into alternatives.
The only other Ruby library I'm aware of is
Watchr, but it's not maintained. We should either pull that in and patch up the 1.9 compatibility warnings, or look into Java library alternatives. I suspect that a Java alternative would be the most reliable and cross-platform robust, but I think Watchr is pretty simple, so as long as it doesn't resort to polling as it's default mode of operation and takes advantage of platform specific features for file system events, then it might make sense to spike that before going too far down other paths.Either way this only impacts a version small portion of Doubleshot as a whole, in a single file, so it shouldn't be a huge effort.
Apache has at least a couple different packages for a File System Monitor. One I've seen used in JCI that appears to be non-recursive (which would be annoying as we'd have to glob for subdirectories first), and this one I haven't really looked at yet: http://commons.apache.org/io/api-2.4/org/apache/commons/io/monitor/package-summary.html
If we go down the JAR route, it'd probably be worth polling irc.freenode.net#jruby and see if anyone has any suggestions/experience to offer.