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
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Async and Await Practice

bookChallenge: Implement an Async Stream

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

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

close

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

some-alt