[Twisted-Python] Question about Writing a Stackless Friendly Reactor

glyph at divmod.com glyph at divmod.com
Wed Apr 11 00:12:01 EDT 2007

On 10 Apr, 11:15 am, andrewfr_ice at yahoo.com wrote:
>I have been using Twisted with Stackless. I am
>interested in writing a more Stackless "friendly"
>reactor. I believe a stackless friendly reactor would
>call stackless.schedule() whenever possible.

I disagree.  Separate reactor implementations are for different OS 
multiplexing mechanisms.  stackless.schedule() should *not* be called 
"whenever possible", but rather, whenever stackless tasks have something 
to do.
>I notice there are different types of reactor. I have
>been looking at SelectReactor and its base case,
>Posixbase. It seems easy enough to modify MainLoop to
>put in a stackless.schedule(). However this approach
>does not seem to be the most maintainable or
>effective, since I would be overriding MainLoop only
>to put in one line. What is the proper Twisted
>approach to doing this?

Don't implement a reactor :).

I recently replied to a very similar question in a different thread:


What about my answer there was not clear?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070411/fcaa5181/attachment.htm 

More information about the Twisted-Python mailing list