From dd8c6e3bcc657596313169e522c3443695683210 Mon Sep 17 00:00:00 2001 From: Alexander Shorin Date: Mon, 26 Feb 2018 23:03:21 +0300 Subject: [PATCH] Update examples for async write usage This follows #2483 --- examples/web_srv.py | 4 ++-- examples/web_srv_route_deco.py | 4 ++-- examples/web_srv_route_table.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/web_srv.py b/examples/web_srv.py index 1939edea208..3e73ec13790 100755 --- a/examples/web_srv.py +++ b/examples/web_srv.py @@ -17,7 +17,7 @@ async def intro(request): resp.content_length = len(binary) resp.content_type = 'text/plain' await resp.prepare(request) - resp.write(binary) + await resp.write(binary) return resp @@ -39,7 +39,7 @@ async def hello(request): resp.content_length = len(answer) resp.content_type = 'text/plain' await resp.prepare(request) - resp.write(answer) + await resp.write(answer) await resp.write_eof() return resp diff --git a/examples/web_srv_route_deco.py b/examples/web_srv_route_deco.py index cdd0c0b9535..394f1f6e113 100644 --- a/examples/web_srv_route_deco.py +++ b/examples/web_srv_route_deco.py @@ -22,7 +22,7 @@ async def intro(request): resp.content_length = len(binary) resp.content_type = 'text/plain' await resp.prepare(request) - resp.write(binary) + await resp.write(binary) return resp @@ -47,7 +47,7 @@ async def hello(request): resp.content_length = len(answer) resp.content_type = 'text/plain' await resp.prepare(request) - resp.write(answer) + await resp.write(answer) await resp.write_eof() return resp diff --git a/examples/web_srv_route_table.py b/examples/web_srv_route_table.py index f9ab1938430..73a5d938556 100644 --- a/examples/web_srv_route_table.py +++ b/examples/web_srv_route_table.py @@ -18,7 +18,7 @@ async def intro(request): resp.content_length = len(binary) resp.content_type = 'text/plain' await resp.prepare(request) - resp.write(binary) + await resp.write(binary) return resp @@ -40,7 +40,7 @@ async def hello(request): resp.content_length = len(answer) resp.content_type = 'text/plain' await resp.prepare(request) - resp.write(answer) + await resp.write(answer) await resp.write_eof() return resp