Last active
February 18, 2020 13:18
-
-
Save volker48/ec5cba088fda6bd8e89c053fcad2f552 to your computer and use it in GitHub Desktop.
test fast api event loop blocking code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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