Skip to content

Commit

Permalink
Update examples for async write usage (#2770)
Browse files Browse the repository at this point in the history
This follows #2483
  • Loading branch information
kxepal authored Feb 27, 2018
1 parent f2f8c74 commit 1e9b75a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/web_srv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions examples/web_srv_route_deco.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions examples/web_srv_route_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

Expand Down

0 comments on commit 1e9b75a

Please sign in to comment.