
On 15 Nov 2015, at 10:18, Tobias Oberstein <tobias.oberstein@tavendo.de> wrote:
How does flow-control work with the Go API? How does user code processing chunks received unleash backpressure onto the sender?
One caveat: I am not an expert in what Go is doing here, more a casual user. However, my understanding is that Go code blocks will not handle chunks in parallel, or provide a new chunk until the previous one has been processed (essentially, the ‘chunk handling’ function is processed synchronously, once for each chunk), which means that it does not read more data from the socket. This exerts TCP level back pressure, and can be adjusted to exert HTTP/2 back-pressure if we’re sufficiently careful about it. Generally speaking in Twisted we could achieve this too, by careful use of Deferreds.