sanic/examples
Ashley Sommer 30e6a310f1 Pausable response streams (#1179)
* This commit adds handlers for the asyncio/uvloop protocol callbacks for pause_writing and resume_writing.
These are needed for the correct functioning of built-in tcp flow-control provided by uvloop and asyncio.
This is somewhat of a breaking change, because the `write` function in user streaming callbacks now must be `await`ed.
This is necessary because it is possible now that the http protocol may be paused, and any calls to write may need to wait on an async event to be called to become unpaused.

Updated examples and tests to reflect this change.

This change does not apply to websocket connections. A change to websocket connections may be required to match this change.

* Fix a couple of PEP8 errors caused by previous rebase.

* update docs

add await syntax to response.write in response-streaming docs.

* remove commented out code from a test file
2018-08-18 18:12:13 -07:00
..
request_stream Pausable response streams (#1179) 2018-08-18 18:12:13 -07:00
add_task_sanic.py feat(exapmles): add add_task_sanic.py 2017-08-20 11:11:14 +08:00
authorized_sanic.py feat(examples): add authorized_sanic.py 2017-08-21 22:40:07 +08:00
blueprints.py fix one example and add one example (#1257) 2018-07-11 01:42:34 -07:00
docker-compose.yml Added examples and form processing 2016-10-09 15:28:31 -07:00
Dockerfile Added examples and form processing 2016-10-09 15:28:31 -07:00
exception_monitoring.py reverted back to default 0.0.0.0 host 2017-06-01 14:01:13 -07:00
limit_concurrency.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
log_request_id.py Example logging X-Request-Id transparently 2017-08-29 23:05:57 +03:00
modify_header_example.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
override_logging.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
pytest_xdist.py Let SanicTestClient has its own port 2017-11-06 17:29:32 +09:00
redirect_example.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
request_timeout.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
run_async.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
simple_async_view.py fix one example and add one example (#1257) 2018-07-11 01:42:34 -07:00
simple_server.py Updated examples for 0.5.0 2017-04-11 20:34:55 +00:00
teapot.py add status codes and teapot example 2017-09-13 14:08:29 +02:00
try_everything.py rename function to something else 2018-03-29 15:57:10 -07:00
unix_socket.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
url_for_example.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
vhosts.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00
websocket.html websocket support, using websockets package 2017-02-27 22:35:28 -08:00
websocket.py Clean up of examples. Removes non-core examples, optimizes and restyles remaining to strictly follow PEP 8 styling guidelines. Non-Core examples will be moved to Wiki. 2017-06-01 11:53:05 -07:00