openBackhaul / OperationKeyManagement

Manages keys required for consuming services between applications
Apache License 2.0
3 stars 7 forks source link

segregate scheduler module from on-demand regardUpdatedLink for updateOperationKey functionality #359

Open IswaryaaS opened 1 month ago

IswaryaaS commented 1 month ago

Proposal: To avoid the above behavior, we can segregate the scheduler module into separate module so that they are not inter dependent on each other.

PrathibaJee commented 1 week ago

closed the PR https://github.com/openBackhaul/OperationKeyManagement/pull/366 without merging

Moving the code as a separate module will not resolve the mentioned problem as NodeJs provides a single threaded runtime environment.

Further, please consider the following approaches ,

  1. Notifications received from ALT shall be included in a priority queue. In the cyclic operation , this priority queue shall be considered as priority in every iteration of the for loop and executed immediately.
  2. Instead of the forloop , setTimeout shall be used(with exit criteria index > link.length and timeout set to negligible time that doesn’t effect the performance)
  3. Worker thread shall be initiated to perform the cyclic operation separately. (Remember , worker threads are more costly , so this shall be considered as last option if there is no other way to solve this problem)