3 ms·
Even though it is mentioned in the article, it deserves more than just mention. I find the Async LINQ extensions somewhat lacking. I need to have IAsyncEnumerab
by bouke 4y ago
Even though it is mentioned in the article, it deserves more than just mention. I find the Async LINQ extensions somewhat lacking. I need to have IAsyncEnumerable all the way down: returning an array in `SelectMany` is not possible. Sometimes you mix and match with synchronous code and the `ToAsyncEnumerable()` isn't elegant.
- WorldMaker 4y agoHave you tried importing the System.Interactive.Async package? [0] It's sometimes referred to as "Ix" (Interactive Extensions) to relate it to its older brother System.Reactive (ReactiveX or Rx). It adds a ton of LINQ-style extensions that make flowing between async and sync code easier. Despite the "System" name you always have to install it from NuGet and it's not just available out of the box, but it lights up so many LINQ extensions when installed and paired with a `using System.Linq.Async;`. Though I also think IAsyncEnumerable is even better when paired with Rx, too, as some things are easier to express as Observable "in the middle" as an AsyncEnumerable->Observable->AsyncEnumerable "sandwich". (You can sort of think of it as an pullable Event Source being spread into a push-based message bus/pipeline and then being collected back into a pullable Result feed.) [0] https://www.nuget.org/packages/System.Interactive.Async/ https://www.nuget.org/packages/System.Interactive.Async/