On 9/14/06, <b class="gmail_sendername">Andrew Francis</b> <<a href="mailto:andrewfr_ice@yahoo.com">andrewfr_ice@yahoo.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Christopher:<br><br>>I have no idea how you got there. If you're using the<br>>usual connect and listen methods, connectTCP and<br>>listenTCP (and their siblings for UDP, SSL,<br>>etc), they will certainly not block.
<br><br>To begin, here is Bob Ippolito's answer to my initial<br>problem.<br><br>>From: Bob Ippolito <<a href="mailto:bob@redivi.com">bob@redivi.com</a>><br>>Subject: Re: [Stackless] Blocking Problem with<br>>Stackless Python and Twisted
<br><br>>Twisted isn't designed for Stackless integration, and<br>>the approach you're taking simply will not work.<br><br>>Twisted does block on reactor.run(), and during each<br>>runloop iteration it blocks waiting for a timeout or
<br>>network activity (via select or poll usually).</blockquote><div><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Looking at selectreactor, I see :
<br><br>win32select(r, w, e, timeout=None)<br><br>I'll assume if timeout is None, select will block<br>indefinitely until some activity occurs. And I don't<br>see reactor.run() taking a parameter. So this<br>corresponds with Bob's explanation and my
<br>observations. I haven't looked but I will assume<br>LoopCall under the hood sets the timeout on the<br>select.</blockquote><div><br>It is true that reactor.run() blocks, but once you're inside the
running reactor, you can end up using stackless in such a way as to not
even notice. You could write a toolkit that looks entirely different from typical Twisted-looking code using Stackless without changing Twisted at all. The stackless/deferred integration module I wrote gets you most of the way there, and further possibilities involve stuff like a synchronous-looking protocol handling API.
<br></div></div><br clear="all"><br>-- <br>Christopher Armstrong<br>International Man of Twistery<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://twistedmatrix.com/">http://twistedmatrix.com/
</a><br><a href="http://canonical.com/">http://canonical.com/</a><br>