[Twisted-Python] IPushProducer - medium volume streaming

Rutt, Benjamin Benjamin.Rutt at gs.com
Sun Oct 28 11:51:28 EDT 2007


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 at twistedmatrix.com
[mailto:twisted-python-bounces at 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 at 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 at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list