scttnlsn/monq — pull request #39 by jpwilliams (2014-09-19 15:00:12+00:00)
Title: Let workers choose tasks based on their given callbacks

Currently, if a job is put in a queue with an unknown function name (i.e. the workers assigned to that queue do not have that function registered), Monq will spurt an error and the job will fail. This not only fixes that, but allows multiple workers to be assigned to various tasks within the same queue.

For our own personal use, we wanted there to be ten individual workers pulling jobs from a queue. Some jobs that came in would take a long time and we classes these as "heavy jobs." We wanted there to be a cap (let's say 5) on the amount of heavy jobs that could be processed at any one time, whilst having those same workers also help with regular tasks if there were no heavy tasks present.

This quick fix allows you to assign different workers different or additional callbacks to pull jobs all out of the same queue.

Seemed a quick fix to provide some useful extra functionality!