[Backgroundrb-devel] Multiple worker threads per type per server?

benjamin smith smith.benjamin at gmail.com
Fri Aug 22 00:49:42 EDT 2008

Oooo, i think i get it now. I wasn't explicitly setting a worker_key
when enqueuing jobs, so an empty string was being placed into the
bdrb_job_queues.worker_key field. When starting up the default worker
threads, they get started with a worker_key of "" (empty string), thus
there is a match. I see!

Now understanding that, after a bit of experimentation, it seems that
it is possible to start new workers with duplicate worker_keys. So, I
just used the console to start up another worker of the type I wanted
with a worker_key of empty string, and voila!

MiddleMan.new_worker(:worker=>:foo_worker, :worker_key=>"")

Now, I just need to figure out how to start multiples by default when
BackgroundRb spins up! Or, perhaps it makes better sense to have a
monitoring function set on a schedule that will spin up another worker
instances once the queue grows to a certain length...

Regardless, thanks for triggering the synapses needed for me to figure this out!


More information about the Backgroundrb-devel mailing list