Skip to content

Conversation

@mchekh
Copy link

@mchekh mchekh commented Sep 15, 2023

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

  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md
  • update .d.ts typings

@mchekh mchekh force-pushed the feat/advanced-balancing branch from cf55a5f to f845c59 Compare September 15, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant