[Twisted-Python] Wrapping a Perspective

Andrew Francis andrewfr_ice at yahoo.com
Wed Sep 5 13:54:34 EDT 2007

Hi Rasjid:

> It might be possible to create a new twisted reactor
> that integrates into the python com server event
>loop. That would presumably be the correct way to
>deal with this. But that would seem like far more
> that I have time to devote to this problem at this
> time.

Hopefully, I understood your problem correctly...
If you are willing to use Stackless Python, I would
recommend you use Christopher Armstrong's
threadlesss.py blockOn function. This would allow
Twisted calls to block. A few months ago, I posted a
solution that would work, but it would be overkill. 

I am also curious why you can't use inline callbacks?

If I can find the time, I will post an example.

> So my question really is:
> What are the problems / brawbacks with running the
> twisted reactor in
> a non-main thread, provided all calls to the reactor
> are done through
> twisted.internet.blockingCallFromThread?

I have used threads with Twisted and Stackless and
found I took a performance hit. Also I found it
prudent to heed the advice and try not to mix threads
with Twisted (or Stackless)


Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

More information about the Twisted-Python mailing list