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

Documentation: "Using Scopes to manage Resources" #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bschnitz
Copy link

I tried to make a minimal example on how to automatically free resources with a custom Scope. Since I'm still learning how to use the python-injector, there may be many misconceptions, so please have a firm look.

connections. If those resources are shared between multiple classes and should
not be freed and reallocated in between, then using the :class:`SingletonScope` seems
to be the right choice. However resources are not freed automatically afterwards
and bookkeeping must be done manually. However to with some small additions to
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, remove to.

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.

None yet

1 participant