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

Modules discovery process rethinking #49

Open
diafour opened this issue Sep 20, 2019 · 1 comment
Open

Modules discovery process rethinking #49

diafour opened this issue Sep 20, 2019 · 1 comment
Milestone

Comments

@diafour
Copy link
Contributor

diafour commented Sep 20, 2019

Discovery process is now performed statically: it calculates enable state for all modules at once. The better way is to calculate first enabled module and run it, then calculate next enabled module and run it, go on until all modules are run. This, more dynamical algorithm, also helps resolve #16 and #43.

@diafour
Copy link
Contributor Author

diafour commented Apr 3, 2020

The idea is to make ReloadAllModules process dynamic to bring in module dependencies and immediate reaction to the changes in global values.

A preliminary plan:

  • create a new task type RunOrDiscoverNextModule
  • add flags NeedDiscover and NeedRun in the module struct
  • RunOrDiscoverNextModule task is queued when globals values are changed or modules values are changed
  • RunOrDiscoverNextModule algorythm:
    • search in allModules index the first module that needs to discover or to run
    • run this module
    • search for module again
    • if there is one, queue another RunOrDiscoverNextModule to the end of the queue. This step gives ability to execute schedule or kubernetes hooks between module runs.

Modules dependencies
If a module config will have a list of after module, RunOrDiscoverNextModule tasks can be queued into different queues and modules will run in parallel.

@diafour diafour added this to the 1.0.0-beta.7 milestone Apr 3, 2020
@diafour diafour removed this from the 1.0.0-beta.7 milestone Jun 26, 2020
@diafour diafour added this to the v2 milestone Apr 5, 2021
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

No branches or pull requests

1 participant