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

Rearchitect based on recipes and modules #74

Closed
rishabhpoddar opened this issue Oct 14, 2020 · 1 comment
Closed

Rearchitect based on recipes and modules #74

rishabhpoddar opened this issue Oct 14, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@rishabhpoddar
Copy link
Contributor

rishabhpoddar commented Oct 14, 2020

Core

  • Load the configs
  • Load the storage layer
  • Parse CLI args
  • Start cronjob scheduler
  • Start webserver
  • Load module manager (see below)
  • Load version file
  • Initialise logging
  • Listen for kill signal (and propagates them to the modules)

Module manager

Should be responsible for:

  • Loads all the module JARs and their dependencies from the /modules/ directory in the installation location

  • Routing of an API to a module:

    • Check if the API path starts with /recipe. If not, then perhaps it's for a different functionality in the core.
    • Ask all modules if they can handle the current API request.
    • If 0 modules say yes, then return 404
    • If 1 module says yes, then pass the task to that module
    • If > 1 say yes, then get the rId of that module and check it against the header's rId:
      • If the header has no rId, then throw an error saying "Please pass the rId in the header request. One of "rId1", or "rId2",...
      • If no rId match, then throw an error saying "Have you passed the correct rId in the request? Please use one of ...
      • If more than one match, then throw an error asking if one module has been specified two times in the /modules/ directory?
      • Pass the task to the one that matches.
  • Provides a module interface (module-interface) that:

    • Asks a module if they can handle the current path (excluding /recipe) and method.
    • Gets the module's rId
    • Lets a module handle an API request
    • Allow a module to schedule a cronjob
    • All a module to interact with the underlying storage layer
    • Allow the module to use the apiKey if needed
    • Provide error and console logging functionality to a module
    • Give the installation path to a module so that they can load files like config.yaml from them
    • Let modules query for the version info
    • Propagates a stop signal to the module

Plugin interface change:

Changes to config:

Please see #76

@rishabhpoddar
Copy link
Contributor Author

Not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant