[Twisted-Python] deferred generators in inline callbacks
Andrew Francis
andrewfr_ice at yahoo.com
Wed Dec 21 11:06:16 MST 2011
Message: 2
Date: Tue, 20 Dec 2011 19:14:10 -0000
From: exarkun at twistedmatrix.com
Subject: Re: [Twisted-Python] deferred generators in inline callbacks
To: Twisted general discussion <twisted-python at twistedmatrix.com>
Message-ID:
<20111220191410.2164.1501005671.divmod.xquotient.42 at localhost.localdomain>
Content-Type: text/plain;
charset="utf-8"; format="flowed"
On 06:24 pm, alex.kirp at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20111221/a3d4bd74/attachment-0001.html>
More information about the Twisted-Python
mailing list