Open devax opened 3 years ago
Thanks for the suggestion. As far as I know, most DisposeAsync implementations are not truly asynchronous. There is actually a perf penalty when using DisposeAsync for those IAsyncDisposable interfaces. Because they fake async using thread-pool threads, we waste at least one thread blocking on I/O.
It is not possible to understand whether DisposeAsync operation is truly asynchronous and does not fake it. Sometimes, this even depends on the parameters of the constructor: new FileStream(..., useAsync: true)
Thank you for this great extension!
I have realized that I often miss the presence of IAsyncDisposable interfaces and there is no warning that indicates this. Example:
This could (should?) be converted to:
Would it be a good idea to add a warning or an information, that
await using
could be used instead ofusing
?