Build an Event Loop

generator coroutines on a ready queue

Challenge 7 of Async & MessagingAdvanced~75 min

Write your own tiny asyncio-style event loop from scratch: a ready queue, generator-based coroutines that cooperate with yield, a virtual clock for sleep, and gather to run coroutines concurrently.

5 steps

  1. 1The Ready Queue
  2. 2Coroutines as Tasks
  3. 3Return Values
  4. 4Sleeping on a Virtual Clock
  5. 5Running Coroutines Concurrently
Start step 1