Re: [Twisted-Python] Run Twisted reactor from a Thread

2015-02-03 Thread Adi Roiban
On 3 February 2015 at 14:41, Abdelhalim Kadi wrote: > Hello; > > When i run reactor from thread in a synchrone python program, the twisted > code is never called. > > To resolve this problem, I had to put a sleep. > > def _reactor_thread(self): > if not self.reactor.running: > self.rea

Re: [Twisted-Python] Run Twisted reactor from a Thread

2015-02-03 Thread dw+twisted-python
If you can, check out Crochet. It wraps up most of the mess involved in making this work, and vastly simpliies the experience.. http://crochet.readthedocs.org/en/latest/ David On Tue, Feb 03, 2015 at 03:41:17PM +0100, Abdelhalim Kadi wrote: > Hello; > > > When i run reactor from thread in

[Twisted-Python] Run Twisted reactor from a Thread

2015-02-03 Thread Abdelhalim Kadi
Hello; When i run reactor from thread in a synchrone python program, the twisted code is never called. To resolve this problem, I had to put a sleep. def _reactor_thread(self): if not self.reactor.running: self.reactor.run(installSignalHandlers=0) def _start_thread( self ): se