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

Define the lifetime of the system and a component in the system #11

Open
oubiwann opened this issue Feb 19, 2020 · 1 comment
Open

Define the lifetime of the system and a component in the system #11

oubiwann opened this issue Feb 19, 2020 · 1 comment

Comments

@oubiwann
Copy link
Contributor

Plan can be iterated in comments ...

@oubiwann
Copy link
Contributor Author

Registry actions

  • Add a system to the registry (supply key)
  • Add one or more components to the registry (requires system key; supply component keys)
  • Get a system from the registry
  • Get all the components of a system from the registry
  • Get one component of a system from the registry (requires system key, component key)

The registry is an in-memory database only; it doesn't know how a system should be run, when components should be started, etc.

System lifecycle

  • Get system dependencies (topological sort on all system components)
  • Startup a system
       * get all the components for the system
       * sort them in reverse topological order
       * iterate, getting their references from the registry
       * set each component's status to "starting"
       * iterate again, calling the component's start method and
       * setting each component's status to "running"
  • Shutdown a system (which will stop all the components in reverse start-order)
       * get all the components for the system
       * sort them in topological order
       * iterate, getting their references from the registry
       * set each component's status to "stopping"
       * iterate again, calling the component's stop method and
       * setting each component's status to "terminated"
  • Health check of a system
       * check the status of each component
       * for a component whose health check fails, set status to "failing"
       * for a component that has no retry strategy configured, set status to "failed"
       * for a component that does have a retry strategy configured, set status to "retrying"
       * perform strategy
       * if successful, set status to "recovering"
       * if unsuccessful, set status to "failed"
       * if health check passes and current status isn't "running" set to "running"

Also, offer registry wrapping methods:* register component* get all components* get one component

Component lifecycle

  • start a component
  • stop a component
  • set the status of a component
  • provide a status on the health of a component

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