| 1 |
.. _backpressure: |
| 2 |
|
| 3 |
Managing backpressure |
| 4 |
===================== |
| 5 |
|
| 6 |
The connection between Hypercorn and a client can be paused by either |
| 7 |
party to allow that party time to process the information it has |
| 8 |
received, i.e. to catch up. When the connection is paused the sender |
| 9 |
effectively receives pressure to stop sending data. This is commonly |
| 10 |
termed back pressure. |
| 11 |
|
| 12 |
Hypercorn will respond to client backpressure by pausing the sending |
| 13 |
of data. This back pressure will propogate back to any ASGI framework |
| 14 |
via a blocked (without blocking the event loop) ASGI send |
| 15 |
awaitable. In other words any ``await send(message)`` calls will block |
| 16 |
the coroutine till the client backpressure has abated or the |
| 17 |
connection is closed. |