Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Implement an Async Stream | Async Loops and Processing Collections
C# Async and Await Practice
close
SectionΒ 2. ChapterΒ 6
single

single

bookChallenge: Implement an Async Stream

Swipe to show menu

Task

Swipe to start coding

Create an asynchronous iterator method that yields a sequence of numbers with a delay between each value, and consume it using await foreach.

  • The method GenerateNumbersAsync must asynchronously yield integers from 1 up to and including count.
  • There must be an asynchronous delay of delayMilliseconds between each yielded number.
  • The Main method must consume the async stream using await foreach and process each yielded value.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 6
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt