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

Andrew McNabb amcnabb at mcnabbs.org
Thu Mar 6 12:33:39 EST 2008


On Thu, Mar 06, 2008 at 12:22:04PM -0500, Christopher Armstrong wrote:
> 
> 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".

Now we understand each other.

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

I am opposed to creating a brand new IStreamingRequestHandler.  That's
just more conceptual overhead.  However, if it were to use something
that already exists, like IProtocol as Glyph suggested, I would be more
accepting.

In that case the difference is that the former has an event-driven feel
and the latter doesn't.  Which is better?  It depends on what you're
doing.  If you have multiple places that need notification that data
have arrived (as is the case in my situation), there are some definite
advantages to the event-driven approach.  However, the latter is
probably a little faster.


-- 
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20080306/2fc1d3f3/attachment.pgp


More information about the Twisted-web mailing list