maldoinc / wireup

Performant, concise, and easy-to-use dependency injection container for Python 3.8+.
https://maldoinc.github.io/wireup/
MIT License
97 stars 2 forks source link

Pass known singeltons/parameters when autowiring #6

Open maldoinc opened 11 months ago

maldoinc commented 11 months ago

The @container.autowire decorator will simply return a new function that will bind container objects to the function on call. Since this will happen on every call, even though cached it still has a small performance penalty.

On registration, if the container has been warmed up we should bind any known singleton services and parameters as the container is considered final.