From 24f10400675170cb06b6b56135108465a5ca6b79 Mon Sep 17 00:00:00 2001 From: Mike Griffith Date: Fri, 14 Oct 2016 23:22:05 -0400 Subject: [PATCH] simple example with await. benchmarked performance with ab --- examples/try_everything.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/try_everything.py b/examples/try_everything.py index e6a58d74..80358ddb 100644 --- a/examples/try_everything.py +++ b/examples/try_everything.py @@ -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