IAsyncEnumerable support
See original GitHub issueI have created a converter to add support for IAsyncEnumerable<T>
to Newtonsoft.Json. I explored doing this directly in the Newtonsoft.Json codebase, but because it targets much older framework versions, I deemed this to be infeasible. Instead, I have created a separate library that contains a converter that can be registered to provide bidirectional conversion. As a separate library, it can target .NET Standard 2.0 and use C# 8 and not have to worry about the older framework versions that the main library supports (implementing IAsyncEnumerable
is impossible in pretty much everything in the list other than netstandard2.0
).
I think it would be good to publish this as an easily-discoverable NuGet package, e.g. with the name Newtonsoft.Json.AsyncEnumerable. Is there any chance that it might be accepted into the Newtonsoft.Json codebase in order that it be published in this way?
If not, what would the etiquette be around publishing a NuGet package with that ID under my own ownership? Making it perfectly clear of course in all descriptions & documentation that I was not affiliated with James Newton-King or the .NET Foundation.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (2 by maintainers)
I just Googled this, and found a site outlining the following scenario:
Thus, a deadlock arises.
So, my converter is only a band-aid – it works in constrained testing scenarios, but wouldn’t be a reliable scenario in a service scenario.
Then I fear ASP.NET Core will never properly support
IAsyncEnumerable
. 😦 I’ll have to think about whether there might be some architecture to make it discoverable whether a formatter properly supportsIAsyncEnumerable
.