[Twisted-web] streaming request (was: status of Twisted Web and Web 2)

Christopher Armstrong radix at twistedmatrix.com
Thu Mar 6 12:22:04 EST 2008


On Thu, Mar 6, 2008 at 12:16 PM, Andrew McNabb <amcnabb at mcnabbs.org> wrote:
> On Thu, Mar 06, 2008 at 11:42:15AM -0500, Christopher Armstrong wrote:
>  >
>  > I'm not sure how that applies. I really don't know how it would work.
>  > Generally, getting access to a one-shot deferred is done by calling a
>  > function which represents a request of some sort. This, on the other
>  > hand, is the opposite: the request is being made of the resource, and
>  > some data is being uploaded.
>
>  Seriously, it would be the same.  You call a function which represents a
>  request.  That function knows that the response might come incrementally
>  rather than all at once, so it returns a multi-shot deferred.

Ok, so the new interface is request.getStreamingData(). So the
explanation of the new feature is either:

"Implement dataReceived and call getStreamingData on the request and
add self.dataReceived as a callback"

or

"declare implements(IStreamingRequestHandler) and implement dataReceived".

Is the former really simpler? Does it really offer any benefit?

-- 
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/



More information about the Twisted-web mailing list