You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Idea:
I suggest adding the ability to disable lazy dependency loading for the 'provide' function or globally for the entire 'Provider'
How is it supposed to work?
When creating a new container, create all dependencies with the 'lazy=False' flag and add them to the cache.
Why do you need it?
Create resource-intensive sessions or pools, as well as detect errors early when creating dependencies and protect against errors during code execution
we probably cannot implement it for async container as it requires async loop, which is often not available at creation point
many real objects are lazy: sqlalchemy engine does not open connections on creation, api clients do not do any requests. So the logic could be more complicated. It can be moved to factory, but anyway
in some cases (lambda functions, pre-fork model in gunicorn and celery with processes) we still want to have lazy initialisation
Idea:
I suggest adding the ability to disable lazy dependency loading for the 'provide' function or globally for the entire 'Provider'
How is it supposed to work?
When creating a new container, create all dependencies with the 'lazy=False' flag and add them to the cache.
Why do you need it?
Create resource-intensive sessions or pools, as well as detect errors early when creating dependencies and protect against errors during code execution
How I see it in the code
Provide
Provider
The text was updated successfully, but these errors were encountered: