Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Batch Processing with Async | Async Loops and Processing Collections
C# Async and Await Practice

bookChallenge: Batch Processing with Async

Task

Swipe to start coding

Write an asynchronous method that processes a list of tasks in batches using Task.WhenAll. The method should execute up to batchSize tasks concurrently, waiting for all tasks in each batch to complete before starting the next batch.

  • For each batch, select up to batchSize task functions from the input list.
  • Start and await all tasks in the batch using Task.WhenAll.
  • Continue processing batches until all task functions in the list have been executed.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

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

close

bookChallenge: Batch Processing with Async

Swipe to show menu

Task

Swipe to start coding

Write an asynchronous method that processes a list of tasks in batches using Task.WhenAll. The method should execute up to batchSize tasks concurrently, waiting for all tasks in each batch to complete before starting the next batch.

  • For each batch, select up to batchSize task functions from the input list.
  • Start and await all tasks in the batch using Task.WhenAll.
  • Continue processing batches until all task functions in the list have been executed.

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Β 4
single

single

some-alt