Merge pull request #6 from bikegriffith/async_await_example
Add example showing use of await
This commit is contained in:
commit
f8b720107e
|
@ -25,6 +25,12 @@ def test_params(request, name, id):
|
|||
def exception(request):
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user