ets-labs / python-dependency-injector

Dependency injection framework for Python
https://python-dependency-injector.ets-labs.org/
BSD 3-Clause "New" or "Revised" License
3.69k stars 295 forks source link

Add additional version of Resources #756

Open cpvandehey opened 8 months ago

cpvandehey commented 8 months ago

It would be really useful to have a Resource type that is capable of having a sync init function with an async shutdown.

There are many scenarios where this is useful

Ex:

  1. Create an aiohttp client. session = aiohttp.ClientSession()

  2. Before closing the app, I want to await any hanging connections await session.close()