[Twisted-Python] Re: Other ways to integrate foreign event loops?

Jean-Paul Calderone exarkun at divmod.com
Thu Apr 3 16:35:06 MDT 2008


On Thu, 03 Apr 2008 15:35:36 -0400, David Bolen <db3l.net at gmail.com> wrote:
> [snip]
>
>In our case, with wxPython based applications, things worked great
>just having wxPython handle a timer that triggered reactor iterations.
>It involved:
>
>* During initialization, start reactor with reactor.startRunning()
>* At some periodic frequency, run reactor.iterate(0)
>* During termination, set up a reactor.callLater for reactor.stop, and
>  then call reactor.mainLoop().  This was the cleanest way we found to
>  permit all reactor finalization (events, final I/O, etc...).
>
>Note that the first point violates the IReactorCore interface

Let me emphasize this.  The above relies on implementation details and may
be broken by any subsequent release (assuming it works now, which I won't
comment on).

Jean-Paul




More information about the Twisted-Python mailing list