Last active
May 22, 2021 12:15
-
-
Save anandtripathi5/972e5df292ac763c1ee9e7b608f317fa to your computer and use it in GitHub Desktop.
Flask 2.0 now supports asynchronous route handlers
This file contains hidden or 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
from flask import Flask | |
import asyncio | |
app = Flask(__name__) | |
@app.get("/data") | |
async def get_data(): | |
await asyncio.sleep(1) | |
return 'Hello' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment