Async streams

.NET Core 3.0 also introduced asynchronous streams support. IAsyncEnumerable<T> is the asynchronous version of IEnumerable<T>. This new feature allows developers to await foreach loops over IAsyncEnumerable<T> to consume elements from the stream and use yield to return a stream to produce elements.

This is very important in scenarios where we want to iterate over elements asynchronously and perform some compute operations on iterated elements. With more emphasis being on big data nowadays (which is available as streamed output), it makes more sense to go for async streams, which support high volumes of data while making servers responsive by efficiently utilizing threads at the same time.

Two new interfaces have been added ...

Get Hands-On Parallel Programming with C# 8 and .NET Core 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.