Open cpvandehey opened 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.
Resource
init
shutdown
There are many scenarios where this is useful
Ex:
Create an aiohttp client. session = aiohttp.ClientSession()
session = aiohttp.ClientSession()
Before closing the app, I want to await any hanging connections await session.close()
await session.close()
It would be really useful to have a
Resource
type that is capable of having a syncinit
function with an asyncshutdown
.There are many scenarios where this is useful
Ex:
Create an aiohttp client.
session = aiohttp.ClientSession()
Before closing the app, I want to await any hanging connections
await session.close()