[Twisted-Python] Streaming HTTP

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Nov 17 22:55:16 MST 2015


> On Nov 17, 2015, at 3:17 PM, Tobias Oberstein <tobias.oberstein at tavendo.de> wrote:
> 
> Am 17.11.2015 um 11:49 schrieb Cory Benfield:
>> 
>>> On 15 Nov 2015, at 10:18, Tobias Oberstein <tobias.oberstein at 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.
> 
> Thing is, HTTP2 multiplexes multiple streams over 1 TCP, and each stream should be flow-controlled individually - and hence can't rely on TCP backpressure for that.

Does HTTP2 have choke/unchoke notifications on individual streams?  Ultimately this does resolve to TCP backpressure, though…

-g





More information about the Twisted-Python mailing list