simple example with await. benchmarked performance with ab
This commit is contained in:
parent
385158b84d
commit
24f1040067
|
@ -25,6 +25,12 @@ def test_params(request, name, id):
|
||||||
def exception(request):
|
def exception(request):
|
||||||
raise ServerError("It's dead jim")
|
raise ServerError("It's dead jim")
|
||||||
|
|
||||||
|
@app.route("/await")
|
||||||
|
async def test_await(request):
|
||||||
|
import asyncio
|
||||||
|
await asyncio.sleep(5)
|
||||||
|
return text("I'm feeling sleepy")
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------- #
|
# ----------------------------------------------- #
|
||||||
# Exceptions
|
# Exceptions
|
||||||
|
|
Loading…
Reference in New Issue
Block a user