Closed jwulf closed 3 years ago
The polling should work like this:
At the moment, it looks like it is repolling every 300ms. It should block, and repoll when capacity is released using the emitter in drainOne()
. Otherwise it will saturate the event loop with unnecessary activity.
This is literally the best idea evah
300 ms is default poll Interval. I am using 5ms for stress testing for worker: pollInterval: Duration.seconds.of (0.005) I think client should limit max threads, to max jobs
The Node client is single-threaded. The event loop has a thread, and the operating system threads handle async I/O.
Given this scenario:
Activate ten jobs at a time, with a timeout of 60 seconds, and rate limit their completion to one every five seconds.
I would expect to see a repoll every
n
seconds, wheren
is something related to the capacity threshold for re-polling, but I see this: