Merge pull request #592 from weargoggles/patch-1

Document synchronous response.write in streaming
This commit is contained in:
Raphael Deem 2017-03-27 20:14:20 -07:00 committed by GitHub
commit 1787f8617f

View File

@ -55,8 +55,8 @@ from sanic import response
@app.route("/streaming") @app.route("/streaming")
async def index(request): async def index(request):
async def streaming_fn(response): async def streaming_fn(response):
await response.write('foo') response.write('foo')
await response.write('bar') response.write('bar')
return response.stream(streaming_fn, content_type='text/plain') return response.stream(streaming_fn, content_type='text/plain')
``` ```