This update introduces a more adaptive approach to task allocation.
In cases where a worker is occupied processing synchronous code, instead of instantly assigning a task to the worker with the best yet ELU, the task will now attempt to find another available worker or wait for the first free worker. Workers captured from the pool on task invocation and will return back as soon as all synchronous code in the first event loop cycle is completed.
In cases when tasks consist of periodic asynchronous and large blocking operations some other tasks can be trapped but one of the next tasks will capture the worker until starts executing, in addition to ELU balancing it gives more smooth distribution and makes allocation more durable to the task fluctuations.
Decomposed pool and balancing logic
Added worker availability logic
Implemented tread wait logic
Added balancing customisability
[x] tests and linter show no problems (npm t)
[x] tests are added/updated for bug fixes and new features
[x] code is properly formatted (npm run fmt)
[ ] description of changes is added in CHANGELOG.md
This update introduces a more adaptive approach to task allocation. In cases where a worker is occupied processing synchronous code, instead of instantly assigning a task to the worker with the best yet ELU, the task will now attempt to find another available worker or wait for the first free worker. Workers captured from the pool on task invocation and will return back as soon as all synchronous code in the first event loop cycle is completed. In cases when tasks consist of periodic asynchronous and large blocking operations some other tasks can be trapped but one of the next tasks will capture the worker until starts executing, in addition to ELU balancing it gives more smooth distribution and makes allocation more durable to the task fluctuations.
Decomposed pool and balancing logic
Added worker availability logic
Implemented tread
wait
logicAdded balancing customisability
[x] tests and linter show no problems (
npm t
)[x] tests are added/updated for bug fixes and new features
[x] code is properly formatted (
npm run fmt
)[ ] description of changes is added in CHANGELOG.md
[x] update .d.ts typings