A series of obstactle courses as a way to compare how different languages and frameworks handle structured concurrency, including:
- loser cancellation
- resource management
- efficient thread utilization (i.e. reactive, non-blocking)
- explicit timeouts
- errors causing a race loss
A scenario server validates the implementations of 11 scenarios:
-
Race 2 concurrent requests
GET /1
-
Race 2 concurrent requests, where one produces a connection error
GET /2
-
Race 10,000 concurrent requests
GET /3
-
Race 2 concurrent requests but 1 of them should have a 1 second timeout
GET /4
-
Race 2 concurrent requests where the winner is a 20x response
GET /5
-
Race 3 concurrent requests where the winner is a 20x response
GET /6
-
Start a request, wait at least 3 seconds then start a second request (hedging)
GET /7
-
Race 2 concurrent requests that "use" a resource which is obtained and released through other requests. The "use" request can return a non-20x request, in which case it is not a winner.
GET /8?open GET /8?use=<id obtained from open request> GET /8?close=<id obtained from open request>
-
Make 10 concurrent requests where 5 return a 200 response with a letter, when assembled in order of when they responded, form the "right" answer
GET /9
If your implementation is correct, each race will result in a 200 response with a body:
right
The scenario server has a public container ghcr.io/jamesward/easyracer
and if you contribute your client to this repo, use Testcontainers and include automated integration tests.
For local dev you can spin up the server via Docker:
docker run -it -p8080:8080 ghcr.io/jamesward/easyracer --debug
Name | Source | Tests | Author | Notes |
---|---|---|---|---|
Scala 3 + ZIO | scala-zio | James Ward | ||
Scala 3 + ox | scala-ox | Adam Warski | ||
Kotlin + Coroutines | kotlin-coroutines | Jack Leow | ||
Kotlin + Splitties | kotlin-splitties | James Ward | ||
Kotlin + Arrow | kotlin-arrow | James Ward | ||
Java + Loom | java-loom | James Ward | ||
Python + AIOHTTP + TaskGroup | python-aiohttp-taskgroup | James Ward Bruce Eckel | ||
Python + AIOHTTP | python-aiohttp | James Ward | Unable to get it working | |
Python + HTTPX + asyncio | python-httpx-asyncio | James Ward | Unable to get it working | |
Python + HTTPX + Trio | python-httpx-trio | James Ward | Unable to get it working | |
Go | go-stdlib | Jack Leow | ||
Swift + Grand Central Dispatch | swift-dispatch | Jack Leow | ||
Swift + async/await | swift-async | Jack Leow | ||
Swift + Combine | swift-combine | Jack Leow | ||
Elm | elm-worker | Jack Leow | ||
Rust + Tokio | rust-tokio | James Ward and Rust Developer Retreat Participants | ||
JavaScript | javascript-stdlib | James Ward | ||
JavaScript + Effection | javascript-effection | Charles Lowell |