Skip to content

Instantly share code, notes, and snippets.

@volker48
Last active February 18, 2020 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save volker48/ec5cba088fda6bd8e89c053fcad2f552 to your computer and use it in GitHub Desktop.
Save volker48/ec5cba088fda6bd8e89c053fcad2f552 to your computer and use it in GitHub Desktop.
test fast api event loop blocking code
import time
from fastapi import FastAPI
app = FastAPI()
@app.get("/fast")
async def fast():
return {"message": "i was fast"}
@app.get("/slow")
async def slow():
time.sleep(10)
return {"message": "i will block /fast"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment