redding/qs — pull request #13 by jcredding (2013-09-04 13:17:34+00:00)
Title: Add `Daemon` work loop that uses `DatWorkerPool`

This adds the logic to the work loop to use a worker pool. The
`Daemon` will build a worker pool using it's configuration and add
work to it from the queue. Work is only added when there is a
worker available and the pool doesn't already have work. This will
minimize the main work loop thread from pulling all jobs out of
redis and into the in-memory queue. This sets up pulling jobs from
the queue using redis and actually running a job with a configured
handler using a `Qs::Daemon::Worker`.

We don't want jobs pulled out of Redis and into the memory because
we never know when the process will be stopped or restarted. When
this happens, any jobs in-memory have to either be run or they will
be lost. Eventually, the shutdown logic for the daemon will run any
remaining jobs before shutting down.

@kellyredding - This is still needs to have a version of `DatWorkerPool` rolled before I'm ready to merge it.