Open silkfire opened 4 years ago
Currently Grace only disposes IDisposable
dependencies. Ultimately the problem lies in the fact that linq expressions don't support async so it's very hard to implement any of the async functionality.
@silkfire Thanks for the update. I checked out the relevant issue over at csharplang
and progress seems very slow. Let's hope this gets implemented soon enough!
@ipjohnson is this issue still relevant? Would be happy to look into it and contribute 😃
Sorry I've been super busy and missed this notification. I think this issue is somewhat relevant, the question would be what's the use case as asp.net core won't perform an async dispose of the container when shutting down so you'd need to call it yourself.
the question would be what's the use case as asp.net core won't perform an async dispose of the container when shutting down so you'd need to call it yourself.
I will check that in detail, but as I can already see, AspNetCore 5.0+ supports IAsyncDisposable service providers:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.serviceprovider?view=dotnet-plat-ext-5.0 https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpresponse.registerfordisposeasync?view=aspnetcore-5.0
I wasn't aware that was added. Looks like a good feature to add.
Cool, I've already started working on it.
Basically, we will have to make changes in the Grace and then in the Grace.DependencyInjection.Extensions package.
I will open PR to Grace throughout next week, so we can discuss.
A few points I want to highlight:
Sounds good, look forward to the PRs.
Does Grace automatically dispose not only services implementing
IDisposable
but also the newly introduced (.NET Standard 2.1 / .NET Core 3.0) async version namedIAsyncDisposable
?