collectiveidea/delayed_job — pull request #342 by dcuddeback (2012-01-27 20:20:27+00:00)
Title: Makes the number of jobs read from the queue a configuration option

In a situation where I have a ton of background workers, I found it necessary to increase the number of jobs that a worker reads from the queue when finding an available job. A worker would read five jobs from the queue, and they'd all be locked, so it wouldn't be able to run a job. Increasing the number of jobs read actually *decreased* the read load on the database server.

So this patch makes that value a configurable option: `Delayed::Worker.read_ahead`.