Lots of changes to how the restarter & watcher work.
authorDave Rolsky <autarch@urth.org>
Sat, 2 May 2009 01:55:00 +0000 (01:55 +0000)
committerDave Rolsky <autarch@urth.org>
Sat, 2 May 2009 01:55:00 +0000 (01:55 +0000)
commit7f564068b9da6a88f5c1c9c62b14ecb75d5a98d1
treeefd99109b79254327010cbcd5ea99498c472c750
parent0a4876c2a5ca11bb1d78d4a2f86823d72495ff0c
Lots of changes to how the restarter & watcher work.

First, the "wait on events" loop is no longer in the restarter. The
restarter lets the watcher handle this. When an event happens, the
watcher calls

   $restarter->handle_changes(@events);

This made it _much_ easier to implement the Inotify-based watcher I've
added. Catalyst::Watcher is now a parent & factory. The old watcher
code has been split between ::Watcher and ::Watcher::FileModified.

The FileModified version has been fixed to handle file deletions a
little better, but it's still kind of broken.

The Inotify version handles everything correctly, though sometimes
it's reports of what changed can be off (but it restarts as needed,
and adds new directories to the watch list properly).

Finally, I fixed some bugs in the Helper module where the generated
script did not use the right names for arguments passed when creating
the restarter.
lib/Catalyst/Helper.pm
lib/Catalyst/Restarter.pm
lib/Catalyst/Watcher/FileModified.pm [moved from lib/Catalyst/Watcher.pm with 51% similarity]
lib/Catalyst/Watcher/Inotify.pm [new file with mode: 0644]