
It's a long-running streaming flow so there will be millions of results to send to the client. You're saying I call deferToThread millions of times? -----Original Message----- From: twisted-python-bounces@twistedmatrix.com [mailto:twisted-python-bounces@twistedmatrix.com] On Behalf Of Christopher Armstrong Sent: Sunday, October 28, 2007 10:51 AM To: Twisted general discussion Subject: Re: [Twisted-Python] IPushProducer - medium volume streaming On 10/28/07, Rutt, Benjamin <Benjamin.Rutt@gs.com> wrote:
So using deferToThread, inside my thread, when I have a result to write to the client, I call callFromThread to schedule a write in the reactor loop.
No, if you're using deferToThread, the way you give the result back to the mainloop is by returning the value from the function. Then that result gets fired on the Deferred that deferToThread created. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/ _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python