On Tue, 12 May 2009 14:30:04 -0500, Nick Craig-Wood <n...@craig-wood.com> wrote:
Gabriel <gabr...@opensuse.org> wrote:
 Jean-Paul Calderone escribió:
 > None of the reactors in Twisted are restartable.  You can run and
 stop them
> once.  After you've stopped a reactor, you cannot run it again.  This is
> the
> cause of your problem.
>
> Jean-Paul

 I see.
 Is it possible to do what I want using twisted? or
 I should found another way?

You have to go twisted...

Your program should call reactor.run() once and everything you need
your program to do should be started off from twisted callbacks (eg
timer callbacks or deferred objects).

To get your program to do something immediately after it is started,
use reactor.callLater() before calling reactor.run().

reactor.callWhenRunning can also be used (instead of callLater with a very
short delay).

You can also set stuff up first, /then/ call reactor.run().  eg, it is
completely fine to write:

   reactor.connectTCP(...)
   reactor.run()

Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to