Yield Return ’cause I’m Awaiting Deep Dive into Async Streams
summary
C# 8 adds async streams as a concrete feature: language-level async iterators produce and consumers await IAsyncEnumerable<T> (sample code at github.com/akarpov89/AsyncStreamsDemo) and .NET Core / .NET Standard 2.1 expose BCL async-iterator helpers. Compiler lowers async iterators into a state machine that reuses a ManualResetValueTaskSource to avoid allocations, supports IAsyncEnumerable<T> shapes, and respects EnumeratorCancellation attributes for correct linked CancellationToken behavior. System.Threading.Channels and System.Linq.Async are recommended for bridging push/pull and async LINQ.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:01Exploring Diversity / Pull vs Push
- 5:20Applying Duality / Push
- 12:12C# 8 in Action
- 25:28Lowering and Compiler Internals
- 43:36Async LINQ
- 51:52Summary
- 52:32Questions and Answers
related talks
58mYield at Me, 'Cause I'm Awaiting: Asynchronous Iterators in C# 8
51mYield and Async–Await: How They Work Internally and How to Use Them
01h 11mEverything You (Don’t) Want to Know About Async and Await in C#
01h 00mCorrecting Common Async/Await Mistakes in .NET 8
56mCorrecting Common Async/Await Mistakes in .NET 8
39mPushing 'await' to the Limits: Unleashing Multi-Threading Power in .NET
01h 01mCorrecting Common Async/Await Mistakes in .NET 9
01h 05mCorrecting Common Async/Await Mistakes in .NET 10
