Challenge: Implement an Async Stream
Tâche
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
GenerateNumbersAsyncmust asynchronously yield integers from 1 up to and includingcount. - There must be an asynchronous delay of
delayMillisecondsbetween each yielded number. - The
Mainmethod must consume the async stream usingawait foreachand process each yielded value.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 2. Chapitre 6
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Suggested prompts:
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me a real-world example?
Génial!
Completion taux amélioré à 5.56
Challenge: Implement an Async Stream
Glissez pour afficher le menu
Tâche
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
GenerateNumbersAsyncmust asynchronously yield integers from 1 up to and includingcount. - There must be an asynchronous delay of
delayMillisecondsbetween each yielded number. - The
Mainmethod must consume the async stream usingawait foreachand process each yielded value.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 2. Chapitre 6
single