I don't know if this is where I should be submitting patches, but it's
also an idea/feature request, or something.
It bugs me that every worker polls the database every 5 seconds - If I
wanted something done quickly, I'd just call it with the async prefix,
no? If I'm willing to offload it to 5 seconds later, maybe I'm willing
to let it sit for 10, 20, maybe a full minute before being run.
Anyways, this would make that configurable.
line 136 of vendor/plugins/backgroundrb/server/lib/meta_worker.rb :
- add_periodic_timer(5) { check_for_enqueued_tasks }
+ add_periodic_timer(BDRB_CONFIG[:backgroundrb][:enq_poll_time].nil? ?
5 : BDRB_CONFIG[:backgroundrb][:enq_poll_time])
{ check_for_enqueued_tasks }
Same functionality, but then you could say
:backgroundrb:
:enq_poll_time: 30
And enqueued tasks would poll a lot less. I guess it's really not that
big of a hit on the database, it just bugs me for some reason. Also,
my app in particular might have lots and lots of workers, depending on
how I design the backgroundrb stuff, and 30 workers polling every 5
seconds would be a bit much.
-Woody
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel