[Twisted-Python] Streaming HTTP

Cory Benfield cory at lukasa.co.uk
Tue Nov 17 03:49:04 MST 2015


> 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.

Generally speaking in Twisted we could achieve this too, by careful use of Deferreds.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: </pipermail/twisted-python/attachments/20151117/57c19f18/attachment.sig>


More information about the Twisted-Python mailing list