Open callmephilip opened 7 years ago
Hi, job-collection is optimized for throughput. the pollInterval
is the rate at which processJobs
will ask for work when its local queue is completely empty. When the queue is not empty, it also asks for work each time a job finishes (when the callback is invoked in the worker function).
So in your case, it will request more work immediately after to invoke callback()
. This is by design.
If my understanding of what you want is correct, you can achieve it by simply doing:
// Replace callback(); with:
Meteor.setTimeout(callback, 5000)
I am having a hard time trying to get my job queue. Given the following setup:
I expect
"import/media/sync"
to be called every 30 seconds with 5 jobs (when available). Instead, when timing the calls, I see the worker invoked pretty much immediately after the previous worker finished processing. Am I missing something or misusing the API?