[Twisted-Python] Question about Writing a Stackless Friendly Reactor
Hello : 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 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? Cheers, Andrew ____________________________________________________________________________________ Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
On Tue, 10 Apr 2007 04:15:35 -0700 (PDT), Andrew Francis <andrewfr_ice@yahoo.com> wrote:
Hello :
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 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?
Please see the archives for previous discussions on this topic. Thanks, Jean-Paul
On 10 Apr, 11:15 am, andrewfr_ice@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: http://article.gmane.org/gmane.comp.python.twisted/13946 What about my answer there was not clear?
participants (3)
-
Andrew Francis -
glyph@divmod.com -
Jean-Paul Calderone