nesquena / backburner

Simple and reliable beanstalkd job queue for ruby
http://nesquena.github.com/backburner
MIT License
428 stars 68 forks source link

initial commit of threading worker #120

Open geoffroymontel opened 8 years ago

geoffroymontel commented 8 years ago

I could not make the threads_on_fork worker work with backburner 1.3 (see https://github.com/nesquena/backburner/issues/118), so I decided to make a very simple Threading worker.

Usage is :

QUEUE=job-one:3,job-two rake backburner:threading:work

to start 3 threads for job-one and 1 thread for job-two.

I tried to write some tests but could not make any relevant one.

Anyway the workers survive a beanstalkd server stop and restart during their lives.

This is my first pull request ever on an open source project so don't hesitate to criticize ...

nesquena commented 8 years ago

Thanks for submitting this. If someone else verify that this worker runs as expected, I am happy to merge this in.

geoffroymontel commented 8 years ago

Thanks Nathan ! Maybe @ShadowBelmolve or @danielfarrell may be interested.