question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for `IAsyncEnumerable<T>`

See original GitHub issue

Description

The IAsyncEnumerable<T> type was introduced in C#8 to allow for async streams of data (basically, iterator blocks that can await for inner tasks to produce values and can be iterated over using the new await foreach construct).

Currently, FA doesn’t provide any support for this general-purpose iterator type, forcing people to create their own, or materialize the async stream into a standard collection (using System.Linq.Async’s ToListAsync for example).

Right after starting to use C#8 more, we’ve already identified several real-world use-cases for IAsyncEnumerable and have been struggling to do assertions on them using FA.

It would be great if most (if not all) collection-based assertions were also available for IAsyncEnumerable.

Versions

Missing on the most recent version, 5.9.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:14
  • Comments:23 (15 by maintainers)

github_iconTop GitHub Comments

5reactions
dennisdoomencommented, Jan 1, 2020

That’s a good suggestion and a nice incentive to move people to 6.0.

1reaction
stijnherremancommented, Apr 12, 2022

That sounds like a much more maintainable solution

@jnyrup Just a small note: the System.Linq.Async package provides ToListAsync() and more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IAsyncEnumerable with yield in C# - Code Maze
Let's learn about IAsyncEnumerable and the way to iterate over an IEnumerable collection asynchronously with the yield keyword.
Read more >
System.Text.Json IAsyncEnumerable serialization - .NET
System.Text.Json now supports serializing and deserializing of IAsyncEnumerable<T> instances. Previous behavior. In previous versions, System.
Read more >
Async Streams with IAsyncEnumerable<T> in .NET Core 3
It exposes an enumerator that has a MoveNextAsync() method that can awaited. This means the producer can make asynchronous calls in between ...
Read more >
Linq methods for IAsyncEnumerable
The question was about Linq support to IAsyncEnumerable . Your answer degrade the async collection to a blocking sync cursor which isn't the ......
Read more >
ASP.NET Core 6 and IAsyncEnumerable - Async Streamed ...
This post goes a little bit into details of async streaming which is coming to ASP.NET Core in .NET 6 and shows how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found