Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balancing not working as expected #28

Open
VasilSvirid opened this issue Aug 3, 2022 · 2 comments
Open

Balancing not working as expected #28

VasilSvirid opened this issue Aug 3, 2022 · 2 comments
Labels
bug Something isn't working metarhia-s'22

Comments

@VasilSvirid
Copy link

VasilSvirid commented Aug 3, 2022

const noroutine = require('noroutine');
const module1 = require('./module1.js');
const module2 = require('./module2.js);
noroutine.init({ modules: [module1, module2] });

(async () => {
  const res11 = await module1.method1('value1');
  const res12 = await module1.method2('value2');
  const res22 = await module2.method2('value21');
})();

actual: run one by one in different workers
expected: more suitable example

(async () => {
  const res11 = module1.method1('value1');
  const res12 = module1.method2('value2');
  const res22 = module2.method2('value21');

  await res11;
  await res12;
  await res22;
  // or Promise.all
})();

actual: functions run one by one in first worker 
expected: functions run in parallel 

worker utilization sample for http requests for default options:
actual:
1 -----__________-----
2 _____-----__________
3 __________-----_____
4 ____________________

expected:

1 -----------_------_-
2 _----_--------------
3 _-------------_-----
4 --------_-----------
@VasilSvirid VasilSvirid added the bug Something isn't working label Aug 3, 2022
@georgolden
Copy link
Member

@tshemsedinov @VasilSvirid is this issue fixed?

@vsawake
Copy link

vsawake commented Mar 8, 2023

(VasilSvirid) PR exits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metarhia-s'22
Projects
None yet
Development

No branches or pull requests

4 participants