HomeChallengesRepsProblemsLeaderboardTake a challenge

A deadline and a request to stop

One unresponsive host holds the whole import open. A token is accepted and ignored.

Advanced20 min on the clock5 graded checks · 100 pointsResources and ConcurrencyPro
Graded by reading your code against the checklist below.

What you build

  • Give each call its own timeout
  • Combine that timeout with the caller’s token
  • Check for cancellation between iterations
  • Pass the combined token to the call
  • Dispose both token sources

Done means

A per-call deadline, linked to the caller’s token, honoured in the loop, and disposed.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. Each call gets a deadline+25Rate limiting and cancellation
  2. The deadline is linked to the caller’s token+25Rate limiting and cancellation
  3. Cancellation is checked between iterations+20Rate limiting and cancellation
  4. The linked token reaches the call+15Rate limiting and cancellation
  5. Both token sources are disposed+15Giving resources back

What it teaches

The rest of Resources and Concurrency