[Twisted-Python] Streaming HTTP

Tom Prince tom.prince at ualberta.net
Mon Dec 7 02:39:08 MST 2015


> When the object receiving the request is ready to send a response, it calls…something (sendResponse?) and provides an object implementing a server IResponse. The code in the H2Stream/H2Connection sends the headers, then calls deliverBody on the IResponse, passing H2Connection (again via H2Stream) as the protocol that gets called. In this world, H2Stream actually would need to implement IProtocol as well as ITransport.

Probably the reponse is provided via a deferred returned from the
function that received the request. Following the design of
twisted.web.client.Request, the request would take something like an
IBodyProducer that the stream would have write to it (Probably
indirectly: see
twisted.web._newclient.Request._writeToChuncked/_writeToContentLength).

  Tom




More information about the Twisted-Python mailing list