Add async support
This allows for async functions to be passed to the Flask class
instance, for example as a view function,
@app.route("/")
async def index():
return "Async hello"
this comes with a cost though of poorer performance than using the
sync equivalent.
asgiref is the standard way to run async code within a sync context,
and is used in Django making it a safe and sane choice for this.
This commit is contained in:
parent
85b8fab268
commit
6979265fa6
11 changed files with 165 additions and 9 deletions
5
setup.py
5
setup.py
|
|
@ -9,5 +9,8 @@ setup(
|
|||
"itsdangerous>=0.24",
|
||||
"click>=5.1",
|
||||
],
|
||||
extras_require={"dotenv": ["python-dotenv"]},
|
||||
extras_require={
|
||||
"async": ["asgiref>=3.2"],
|
||||
"dotenv": ["python-dotenv"],
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue