Merge pull request #592 from weargoggles/patch-1
Document synchronous response.write in streaming
This commit is contained in:
commit
1787f8617f
|
@ -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')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user