[Backgroundrb-devel] Sequence of multiple background process submissions

Raghu Srinivasan raghu.srinivasan at gmail.com
Sat Apr 12 01:57:57 EDT 2008

I have a question on how multiple b/g processes that are kicked off get
handled in terms of sequence/schedule.

On my site, a user enters an RSS feed to be processed and since this takes
about 5-10 secs, I pass the process off to a background job and meanwhile do
some Ajaxy spinners and tap-dancing until the job completes and then
redirect_to the appropriate page. This works great.

I also need to do a batch refresh of all feeds at night. I am doing these
also in the b/g. Now, in a loop, if I submit 100 b/g jobs, the jobs get
processed sequentially. However, if a web user comes along during this batch
job and adds his feed, then the b/g process to serve him gets called only
after the 100th batch job has completed. Am I correct in assuming that this
is expected behavior?

Next, is there a way around this? Can I have 2 threads/processes/ports/etc
for Bdrb so that the batch job doesn't interfere with a live user's
experience. Or any other workaround for this? Right now if the web user
comes along when 50 jobs are left and each job takes 10 secs, then he has a
nearly 10 minute wait, which sucks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080411/07df8aa1/attachment.html 

More information about the Backgroundrb-devel mailing list