cowboyd / easyracer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Easy Racer

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:

  1. Race 2 concurrent requests

    GET /1
    
  2. Race 2 concurrent requests, where one produces a connection error

    GET /2
    
  3. Race 10,000 concurrent requests

    GET /3
    
  4. Race 2 concurrent requests but 1 of them should have a 1 second timeout

    GET /4
    
  5. Race 2 concurrent requests where the winner is a 20x response

    GET /5
    
  6. Race 3 concurrent requests where the winner is a 20x response

    GET /6
    
  7. Start a request, wait at least 3 seconds then start a second request (hedging)

    GET /7
    
  8. 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>
    
  9. 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

Clients

Name Source Tests Author Notes
Scala 3 + ZIO scala-zio tests James Ward
Scala 3 + ox scala-ox tests Adam Warski
Kotlin + Coroutines kotlin-coroutines tests Jack Leow
Kotlin + Splitties kotlin-splitties tests James Ward
Kotlin + Arrow kotlin-arrow tests James Ward
Java + Loom java-loom tests James Ward
Python + AIOHTTP + TaskGroup python-aiohttp-taskgroup tests James Ward Bruce Eckel
Python + AIOHTTP python-aiohttp tests James Ward Unable to get it working
Python + HTTPX + asyncio python-httpx-asyncio tests James Ward Unable to get it working
Python + HTTPX + Trio python-httpx-trio tests James Ward Unable to get it working
Go go-stdlib tests Jack Leow
Swift + Grand Central Dispatch swift-dispatch tests Jack Leow
Swift + async/await swift-async tests Jack Leow
Swift + Combine swift-combine tests Jack Leow
Elm elm-worker tests Jack Leow
Rust + Tokio rust-tokio tests James Ward and Rust Developer Retreat Participants
JavaScript javascript-stdlib tests James Ward
JavaScript + Effection javascript-effection Charles Lowell

About


Languages

Language:Shell 23.7%Language:Batchfile 22.9%Language:Swift 13.7%Language:Scala 8.5%Language:Python 8.4%Language:Elm 6.4%Language:Kotlin 4.5%Language:Java 3.0%Language:Rust 2.6%Language:JavaScript 2.4%Language:Go 2.0%Language:TypeScript 1.5%Language:Nix 0.4%