-
Notifications
You must be signed in to change notification settings - Fork 81
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
How to handle resources? #251
Comments
I unfortunatly didn't have time to look into this myself yet. But there seems to be a similar, already resolved issue covering release of resources: #119 |
Yeah, thank you for your reply, I ended up using fastapi-injector even out of the "Fast API context". Thanks to the custom scope that this library offers. I guess it's something similar to flask injector |
Hey @mario-gazzara, Yeah, there's no built-in mechanism for what you need here. I'd suggest going the explicit context manager route (or similar) for the time being. I'm not opposed to introducing a mechanism for this, it's just that I haven't had a need for this in the past so my understanding of the use cases is likely poor and I don't quite have the motivation to do it myself. @bschnitz linked to something that I think we could put in the library's documentation. |
Hi all,
I come from the dependency injector library, and recently I've been exploring another library to see if it could potentially replace dependency injector altogether.
I find it quite interesting, but I still have some doubts. For instance, how can I manage resource releases with this new library?
Let's consider a scenario where I have a client that needs to be released in a certain time (out of scope, raising an exception or at the end of a job to clean all resources):
Is there a provider within this library to handle such resources, or should I manually handle acquisition and release by passing it as a context manager?
Thank you for your support!
The text was updated successfully, but these errors were encountered: