benmanns/goworker — pull request #4 by ghais (2013-09-22 18:12:24+00:00)
Title: When polling jobs from multiple queues randomize which queue we pull from

Given 2 queues Q1 and Q2 where either Q1 or both of them have a lot of jobs scheduled
then it is possible for Q2 to starve. In this patch we randomize which queue we
pull from on each request.

Although this way we loose the ability to prioritize queues based on their order
in --queues in effect it seems like a small price to pay in environments where
multiple queues have a lot of jobs.

I tried to look to see if the prioritization of queues is a documented behavior in Resque but I couldn't any documents. If it is then please ignore this request.