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

Service containers #1373

Open
bartfeenstra opened this issue Apr 6, 2024 · 0 comments · May be fixed by #1378
Open

Service containers #1373

bartfeenstra opened this issue Apr 6, 2024 · 0 comments · May be fixed by #1378
Labels
enhancement New feature or request python Pull requests that update Python code
Milestone

Comments

@bartfeenstra
Copy link
Owner

bartfeenstra commented Apr 6, 2024

Add service containers to Betty in order to provide a single solution to managing service dependencies, rebuilds, and service visibility/scope/context, e.g. a service can be available for Projects but not for Apps.

Goals

  • Provide a single API for declaring and getting services
  • Gather dependencies between services
  • Guard for cyclic dependencies
  • Allow services to be rebuilt dynamically if their dependencies are rebuilt
  • Each dependency factory should receive a service container builder that lets them fetch other services (dependencies) and register additional rebuild callbacks
  • A service container can wrap another, allowing additional services to be declared, or existing ones to be overridden without impacting the wrapped container. This lets us have base app services, and allows projects to make additional ones available through extensions.
  • Services must be lazily instantiated when they are first requested
  • Provide thread-safety through locks where needed
@bartfeenstra bartfeenstra added enhancement New feature or request python Pull requests that update Python code labels Apr 6, 2024
@bartfeenstra bartfeenstra added this to the 0.3.x milestone Apr 6, 2024
@bartfeenstra bartfeenstra linked a pull request Apr 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant