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

Andrew McNabb amcnabb at mcnabbs.org
Thu Mar 6 11:16:10 EST 2008


On Thu, Mar 06, 2008 at 10:55:00AM -0500, Christopher Armstrong wrote:
> 
> This is really overcomplicating things. Calling a method repeatedly
> with some data is a very simple and very effective and very
> conventional way (not a "new system!") of streaming some data to an
> object. This is how our protocol system works: IProtocol.dataReceived
> gets called every time some data comes in over the network.
> LineReceiver.lineReceived gets called every time a line is received.
> In this case, IStreamingRequestHandler.streamingDataReceived could be
> called. I think you should take exarkun's advice. Adding deferreds
> will just make it pointlessly complicated and slower than it needs to
> be.

I appreciate your point, and I can probably be convinced that this way
is better.  However, it's not obvious that calling back multiple times
is pointlessly complicated.  I could easily argue that having dozens of
interfaces like IProtocol and LineReceiver and IStreamingRequestHandler
and IHaveToKeepTrackOfTooManyInterfaces is also pointlessly complicated.

Just in my limited experience with Twisted, figuring out how it deals
with deferreds and callbacks was easy.  Figuring out how all of the
classes and interfaces interact was/is much more difficult.  The problem
is that every time you learn about a new class or interface, you have to
learn all of the nuances of that class.


-- 
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: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20080306/c96b2e7c/attachment.pgp


More information about the Twisted-web mailing list