<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div id="yiv1051770157"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;">Message: 2<br>Date: Tue, 20 Dec 2011 19:14:10 -0000<br>From: <a rel="nofollow" ymailto="mailto:exarkun@twistedmatrix.com" target="_blank" href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a><br>Subject: Re: [Twisted-Python] deferred generators in inline callbacks<br>To: Twisted general discussion &lt;<a rel="nofollow" ymailto="mailto:twisted-python@twistedmatrix.com" target="_blank" href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;<a rel="nofollow" ymailto="mailto:20111220191410.2164.1501005671.divmod.xquotient.42@localhost.localdomain" target="_blank"
 href="mailto:20111220191410.2164.1501005671.divmod.xquotient.42@localhost.localdomain"><span class="yiv1051770157yshortcuts" id="yiv1051770157lw_1324489887_7">20111220191410.2164.1501005671.divmod.xquotient.42@localhost.localdomain</span></a>&gt;<br>&nbsp;&nbsp;&nbsp; <br>Content-Type: text/plain;
 charset="utf-8"; format="flowed"<br><br>On 06:24 pm, <a rel="nofollow" id="yiv1051770157yui_3_2_0_17_1324489889267218" ymailto="mailto:alex.kirp@gmail.com" target="_blank" href="mailto:alex.kirp@gmail.com">alex.kirp@gmail.com</a> wrote:<br><br>A&gt;Hi.<br>A&gt;<br>A&gt;I have a question about inline callbacks usage.<br><br>E&gt;You're basically looking for coroutines - ie, context switching across <br>E&gt;multiple stack frames (from inside some_generator through do_stuff out <br>E&gt;to the implementation of inlineCallbacks).<br><br>E&gt;There are several coroutine libraries for Python.&nbsp; Greenlets is probably <br>E&gt;the most popular.&nbsp; You can use it with Twisted, if you want.<br><br><div class="yiv1051770157yui_3_2_0_17_132448988926754" id="yiv1051770157yui_3_2_0_17_132448988926756" style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div id="yiv1051770157yui_3_2_0_17_1324489889267121"
 class="yiv1051770157yui_3_2_0_17_132448988926761" style="font-family: times new roman,new york,times,serif; font-size: 12pt;">I
 believe Christopher Armstrong&nbsp; a long time ago had corotwine. However if you download the greenlet package and stackless.py, it is not hard to make them interoperate with Twisted. Here is a recent example of how I use them: http://wp.me/pdqoq-3Y<br><br>Cheers,<br>Andrew<br> <span></span></div> </div>  </div></div></div></div></body></html>