Document synchronous response.write in streaming

The Streaming section of the docs was updated to make clear that a synchronous write should be used in the callback, but this section was not updated.
This commit is contained in:
Pete Wildsmith 2017-03-24 10:11:30 +00:00 committed by GitHub
parent 179606feb1
commit 65ae7669f9

View File

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