mperham/girl_friday — pull request #69 by kiwimanman (2013-01-05 06:38:01+00:00)
Title: Does not check for work available on the redis queue

If one process builds up a backlog of work items, other processes will not jump in to help.

An example could be in a single unicorn that schedules more jobs than it can handle alone or a scheduled rake task that queues work and dies while expecting the servers to handle the long running tasks that run to completion.

My solution was to add what is essentially a no-op on a busy queue to check for work messages in the persistance layer but allows users to request the supervisor reach out to the persister without writing such logic into the message processing block.

I have also implemented a simple pollster in the GirlFriday module. It does not run by default and is turned off on #shutdown!

I have tests for all the logic though I had trouble wrapping my head around what test_async was doing. Please let me know if I can clean any of that up to keep the style more consistent.