Skip to content

Conversation

jdconley
Copy link

This is to better to support using this library in application lifecycle management use cases. With this feature you can kick off a resolve for all provided Singleton factory/classes for full scope lifecycle control with having to manually resolve all dependencies.

For example, in a complex application you might:

  1. Have an asynchronous event bus with different application lifecycle events such as preInit and init injected into the scope.
  2. Provide singleton classes and factories that expect that bus to be injected.
  3. Instantiate all singleton classes.
  4. Raise preInit and wait for instances to handle any internal needs such as reading configuration, making db connections, etc.
  5. Raise init to fully initialize where dependencies are free to use each other, expecting everything to be "ready".

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

Successfully merging this pull request may close these issues.

1 participant