On Thu, Mar 06, 2008 at 09:51:00AM -0500, Jean-Paul Calderone wrote:
>>
>> Actually, after looking at my code again, it turns out that what I am
>> doing is actually a mix of attempt 2 and attempt 3.  This is the code
>> that copies the deferred:
>>
>>    newdef = defer.Deferred()
>>    newdef.callbacks = list(self.deferred.callbacks)
>>    newdef.callback(False)
>>
>
> *cries*
>
> You're not supposed to read or write the `callbacks´ attribute like that.

I told you I thought that was ugly.  Do you have a better way to do
this? :)

>> That makes sense, but in the streaming case I really think that you
>> need to call back every time data comes in.
>
> Yes, definitely.  `IStreamingRequestHandler´ would have some method like
> `someMoreRequestDataReceived´ and it would be called as many times as
> necessary for a single request until the entire request body has been
> delivered.

You still want callbacks.  You might have other places that need
notification of the event.  We don't want to call a method over and
over.  We want to _callback_ over and over.


-- 
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868

Attachment: pgpTiMqGaxV5L.pgp
Description: PGP signature

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to