On 20/02/14 13:52 +0100, victor stinner wrote:
Hi,

On 19/02/14 10:09 +0100, Julien Danjou wrote:
>On Wed, Feb 19 2014, Angus Salkeld wrote:
>
>> 2) use tulip and give up python 2
>
>+ use trollius to have Python 2 support.
>
>  https://pypi.python.org/pypi/trollius

So I have been giving this a go.

FYI I'm the author of Trollius project.

Cool, Hi.


We use pecan and wsme (like ceilometer), I wanted to use
a httpserver library in place of wsgiref.server so had a
look at a couple and can't use them as they all have "yield from"
all over the place (i.e. python 3 only). The quesion I have
is:
How useful is trollius if we can't use other thirdparty libraries
written for asyncio?
https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/server.py#L171

Maybe I am missing something?

(Tulip and Trollius unit tests use wsgiref.simple_server module of the standard 
library. It works but you said that you don't want to use it.)


I saw that, but it's used as a test server and doesn't run an asyncio loop.
wsgiref.server does not have any of the yields that we need around reads/writes
but more importantly we need an add_reader() so the whole server does not
block waiting for a new connection. My usecase is to receive a REST request
return a 202 (Accepted) and process the request asyncronously. If the
http server then goes around it's loop and blocks on a read (waiting for
the next request) I never get any processing time scheduled.

Honestly, I have no answer to your question right now ("How useful is trollius ..."). 
asyncio developers are working on fixing last bugs in asyncio (Trollius is a fork, I merge regulary 
updates from Tulip into Trollius) and adding some late features before the Python 3.4 release. This 
Python release will be somehow the "version 1.0" of asyncio and will freeze the API. 
Right now, I'm working on a proof-on-concept of eventlet hub using asyncio event loop. So it may be 
possible to use eventlet and asyncio APIs are the same time. And maybe slowly replace eventlet with 
asyncio, or at least use asyncio in new code.

Ok, thanks for the update.

-Angus


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.

Victor

_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to