[Twisted-Python] IPushProducer - medium volume streaming

Rutt, Benjamin Benjamin.Rutt at gs.com
Mon Oct 29 09:21:37 EDT 2007


Thanks.  Now using callInThread to launch a long-running function on the
server and callFromThread from said function to write results to the
client.

I'm still puzzled how exactly
'reactor.callFromThread(self.transport.writeSomeData(...))' gets routed
to the right client when called from my function.  How does twisted know
which client that message is going to?  After all, it calls it from the
main reactor loop.  i.e. what state does it use to get this right?

-----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 12:11 PM
To: Twisted general discussion
Subject: Re: [Twisted-Python] IPushProducer - medium volume streaming

On 10/28/07, Rutt, Benjamin <Benjamin.Rutt at gs.com> wrote:
> 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?

No, I was just correcting your description of the way that
deferToThread is used.

If you don't want to use deferToThread, then you should probably use a
combination of reactor.callInThread and reactor.callFromThread.

-- 
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