[Twisted-Python] client connecting to 2 servers (nonsimultaneously)

benjamin.bertrand at lfv.se benjamin.bertrand at lfv.se
Thu Jan 13 03:08:15 EST 2011


No need to apologize Jason :-)
Got a lot of useful information in this thread!
Thanks!

Benjamin

Från: twisted-python-bounces at twistedmatrix.com [mailto:twisted-python-bounces at twistedmatrix.com] För Jason Rennie
Skickat: den 12 januari 2011 16:52
Till: Twisted general discussion
Ämne: Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

Benjamin, sorry for providing you with an incorrect explanation.  Jean-Paul, thank you for correcting my broken understanding of callWhenRunning.

Is there a call which puts a function into the reactor's queue of tasks to be completed?

Thanks,

Jason

On Wed, Jan 12, 2011 at 10:26 AM, <exarkun at twistedmatrix.com> wrote:
Although note that if the reactor is already running when you
instantiate the factory, then callWhenRunning will immediately call the
function you pass to it, as demonstrated by this transcript in which the
reactor is already running:

   >>> def foo():
   ...     print 'foo running'
   ...    >>> from twisted.internet import reactor
   >>> reactor.callWhenRunning(foo)
   foo running
   >>>
Jean-Paul


-- 
Jason Rennie
Research Scientist, ITA Software
617-714-2645
http://www.itasoftware.com/



More information about the Twisted-Python mailing list