[openstack-dev] [solum] async / threading for python 2 and 3

Angus Salkeld angus.salkeld at rackspace.com
Sun Feb 23 21:39:40 UTC 2014


On 21/02/14 11:03 +0100, Victor Stinner wrote:
>Le vendredi 21 février 2014, 09:27:49 Angus Salkeld a écrit :
>> >Honestly, I have no answer to your question right now ("How useful is
>> >trollius ...").
>> >(...)
>> >I asked your question on Tulip mailing list to see how a single code base
>> >could support Tulip (yield from) and Trollius (yield). At least check if
>> >it's technically possible.
>
>Short answer: it's possible to write code working on Trollius (Python 2 and 3)
>/ Tulip (Python 3.3+) / CPython 3.4 (asyncio) if you use callbacks. The core
>of the asyncio module (event loop and scheduler) uses callbacks. If you only
>uses callbacks, you can also support Twisted and Tornado frameworks.

Ok, that is a good idea.

>
>For example, the AutobahnPython project adopted this design and thanks to
>that, it supports Trollius, Tulip and CPython asyncio, but also Twisted:
>
>    https://github.com/tavendo/AutobahnPython
>
>So you have to find a WSGI server using callbacks instead of "yield from". It
>should not be hard since asyncio is young, callbacks was the only option
>before greenlet/eventlet, and Twisted and Tornado (which use callbacks) are
>still widely used.

Makes sense. Thanks for taking the time to look into it.

-Angus

>
>Victor



More information about the OpenStack-dev mailing list