On 9/14/06, <b class="gmail_sendername">Andrew Francis</b> &lt;<a href="mailto:andrewfr_ice@yahoo.com">andrewfr_ice@yahoo.com</a>&gt; 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>&gt;I have no idea how you got there. If you're using the<br>&gt;usual connect and listen methods, connectTCP and<br>&gt;listenTCP (and their siblings for UDP, SSL,<br>&gt;etc), they will certainly not block.
<br><br>To begin, here is Bob Ippolito's answer to my initial<br>problem.<br><br>&gt;From: Bob Ippolito &lt;<a href="mailto:bob@redivi.com">bob@redivi.com</a>&gt;<br>&gt;Subject: Re: [Stackless] Blocking Problem with<br>&gt;Stackless Python and Twisted
<br><br>&gt;Twisted isn't designed for Stackless integration, and<br>&gt;the approach you're taking simply will not work.<br><br>&gt;Twisted does block on reactor.run(), and during each<br>&gt;runloop&nbsp;&nbsp;iteration it blocks waiting for a timeout or
<br>&gt;network activity (via&nbsp;&nbsp;select or poll usually).</blockquote><div><br>&nbsp;</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>