Message: 2
Date: Tue, 20 Dec 2011 19:14:10 -0000
From: exarkun@twistedmatrix.com
Subject: Re: [Twisted-Python] deferred generators in inline callbacks
To: Twisted general discussion <twisted-python@twistedmatrix.com>
Message-ID:
    <20111220191410.2164.1501005671.divmod.xquotient.42@localhost.localdomain>
   
Content-Type: text/plain; charset="utf-8"; format="flowed"

On 06:24 pm, alex.kirp@gmail.com wrote:

A>Hi.
A>
A>I have a question about inline callbacks usage.

E>You're basically looking for coroutines - ie, context switching across
E>multiple stack frames (from inside some_generator through do_stuff out
E>to the implementation of inlineCallbacks).

E>There are several coroutine libraries for Python.  Greenlets is probably
E>the most popular.  You can use it with Twisted, if you want.

I believe Christopher Armstrong  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

Cheers,
Andrew