Re: [python-tulip] _SelectorTransport.__del__() before _SSLProtocolTransport.__del__() fatal error

2016-05-24 Thread Victor Stinner
> the problem is that _SSLProtocolTransport.__del__() should be called first You cannot control the order in which objects are destroyed. The problem is that you don't close explictly this transport ;-)

Re: [python-tulip] _SelectorTransport.__del__() before _SSLProtocolTransport.__del__() fatal error

2016-05-24 Thread Victor Stinner
2016-05-23 18:19 GMT+02:00 Jack Bates : > Can you help me understand why _SelectorTransport.__del__() > is called before _SSLProtocolTransport.__del__()? Are you using the debug mode of asyncio? https://docs.python.org/dev/library/asyncio-dev.html#debug-mode-of-asyncio

[python-tulip] New asyncio release on PyPI?

2016-03-25 Thread Victor Stinner
Hi, * The latest asyncio release is now one year old: asyncio 3.4.3 was released at 2015-03-10. * Python 3.5.1 was released at 2015-12-07. * Python 3.5.0 was released at 2015-09-13. Is there a reason why no new asyncio version was released on the cheese shop? I guess that we have to find the

Re: [python-tulip] Fwd: [Eventletdev] important security fix test required

2016-02-29 Thread Victor Stinner
2016-02-29 14:10 GMT+01:00 Andrew Svetlov : > IIRC latest asyncio uses BIO (not socket wrapper) for SSL processing, > so it does never block. What about Python 3.4 which doesn't support BIO? Do you think that the SSL/TLS handshake can block? We use it in asynchronous

[python-tulip] Fwd: [Eventletdev] important security fix test required

2016-02-28 Thread Victor Stinner
Hi, I got this email from the eventlet mailing list. Does asyncio have a similar issue? Victor -- Forwarded message -- From: Sergey Shepelev Date: 2016-02-28 21:25 GMT+01:00 Subject: [Eventletdev] important security fix test required To: eventletdev

[python-tulip] Re: aiotest and new stop semantics

2016-02-22 Thread Victor Stinner
Hi, 2016-02-01 13:05 GMT+01:00 Victor Stinner <victor.stin...@gmail.com>: > When I ran "tox" to validate my changes on CPython stdlib asyncio, I > noticied that aiotest is now failing. Nobody ran tox recently? > > I updated aiotest to support the new stop() semanti

[python-tulip] aioeventlet 0.5 released

2016-02-22 Thread Victor Stinner
Hi, I released aioeventlet 0.5, since the tests failed on the 0.4 Debian package. http://aioeventlet.readthedocs.org/ aioeventlet: "aioeventlet implements the asyncio API (PEP 3156) on top of eventlet. It makes possible to write asyncio code in a project currently written for eventlet." When

[python-tulip] Trollius 2.1 released

2016-02-19 Thread Victor Stinner
Hi, I just deprecated the Trollius project, but I released a new version to unblock Debian which wants to package Trollius for Python 3.5. http://trollius.readthedocs.org/ I trashed my old Windows VM recently, and my new Windows VM doesn't have required Windows SDK to release binary wheel

[python-tulip] Trollius project is now officially deprecated

2016-02-19 Thread Victor Stinner
Hi, I opened a thread on this mailing list one month ago to find a new maintainer for the Trollius project. Since I didn't get any concrete reply, I decided to deprecate the Trollius project. DON’T PANIC! There is the asyncio project which has the same API and is well maintained! Only trollius

[python-tulip] Re: Who use Trollius? Should we deprecate this project?

2016-02-05 Thread Victor Stinner
2016-01-25 21:45 GMT+01:00 Victor Stinner <victor.stin...@gmail.com>: > Short story: I don't want to maintain Trollius anymore. If anyone is > using it, please say it. Ah, someone reported me that 3 OpenStack projects use Trollius and that Trollius doesn't work on Python 3.5

Re: [python-tulip] Re: Who use Trollius? Should we deprecate this project?

2016-01-30 Thread Victor Stinner
Hi, 2016-01-29 17:07 GMT+01:00 Matthias Kirst : > Ok, but it's still a pitty to see trollius die - because in my opinion > asyncio is one of the greatest features of Python 3. And there are lots of > folks out there who can't switch to Python 3. (It's a pain to maintain

Re: [python-tulip] Re: Who use Trollius? Should we deprecate this project?

2016-01-28 Thread Victor Stinner
Hi, 2016-01-28 14:58 GMT+01:00 Matthias Kirst : > We are using the autobahn/trollius framework for inter-process communication > of a Python-COM-component within a .NET-GUI-Application with a HTML5 based > presentation component. > That's great stuff, since even events can be

Re: [python-tulip] Who use Trollius? Should we deprecate this project?

2016-01-26 Thread Victor Stinner
Hi, 2016-01-26 10:27 GMT+01:00 Luca Sbardella : > Thanks, to be honest the decision was quite straightforward at the end: > > * Trollius was too slow on nested coroutines (no yield from) Ah yes, I'm aware of the issue. I documented it a little bit, and I had to modify

[python-tulip] Who use Trollius? Should we deprecate this project?

2016-01-25 Thread Victor Stinner
Hi, Short story: I don't want to maintain Trollius anymore. If anyone is using it, please say it. Otherwise, I will simply make it clear that Trollius must not be used anymore. Since almost no library support Trollius, I'm not sure that it's possible to build an application on top of it. For

Re: [python-tulip] Who use Trollius? Should we deprecate this project?

2016-01-25 Thread Victor Stinner
Hi, 2016-01-25 21:57 GMT+01:00 Tobias Oberstein : > Autobahn, a WebSocket/WAMP library supports running on top of Twisted or > asyncio (and Trollius for Py2): Yeah, it's mentioned in https://trollius.readthedocs.org/libraries.html AutobahnPython, Pulsar and Tornado

Re: [python-tulip] Who use Trollius? Should we deprecate this project?

2016-01-25 Thread Victor Stinner
2016-01-25 23:27 GMT+01:00 Luca Sbardella : > Pulsard does not use trollius anymore. > The last version working with python 2.7 (and trollius) was pulsar 0.9.2, > released more than a year ago. > > Pulsar 1.0.x and 1.1.x is only for python 3.4 and above. > Pulsar 1.2.x

Re: [python-tulip] Cost of async call

2015-11-16 Thread Victor Stinner
You may be interested by the blog post which is not really in favor of asyncio :-) http://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/ Victor 2015-11-12 18:16 GMT+01:00 Imran Geriskovan : > What is the cost/overhead difference > between these

[python-tulip] Add timeout to StreamReader read methods

2015-09-03 Thread Victor Stinner
Hi, I proposed a patch to add timeout to StreamReader read methods: http://bugs.python.org/issue23236 The idea is to reset the timeout each time we receive new data. It is less strict than wait(read(), timeout) which restricts the total duration. The subtle risk is that a server can "DoS" a

Re: [python-tulip] Re: Asyncio run_in_executor() coroutine

2015-09-01 Thread Victor Stinner
If you want to get all results at once, you can use asyncio.gather: https://docs.python.org/dev/library/asyncio-task.html#asyncio.gather By the way, we should write examples for asyncio task functions. It's not obvious how to use them. Victor 2015-09-01 18:16 GMT+02:00 Ons

Re: [python-tulip] await process.wait() hangs forever on process created with a new_event_loop

2015-08-10 Thread Victor Stinner
To me it looks wrong to have two event loops per thread. You must get an error, at least in debug mode. What do you want to do? Victor

Re: [python-tulip] Wiki update of AsyncIO libraries

2015-08-07 Thread Victor Stinner
Le 7 août 2015 19:03, Giampaolo Rodola' g.rod...@gmail.com a écrit : I think this should be referenced in the official asyncio doc. I disagree. This list is moving fast whereas Python doc is moving slowly. Some projects also moved to a new url. I prefer a wiki page and asyncio.org. Victor

Re: [python-tulip] Handling a StreamReader data buffer when calling .read() with no arguments

2015-07-31 Thread Victor Stinner
2015-07-31 6:56 GMT+02:00 Luciano Ramalho luci...@ramalho.org: It seems to me you can't use .read() with no arguments to read data that is not line-oriented and is not the whole transmission either. You must use .read(N), where N is a number of bytes. Then you parse what you get and decide on

[python-tulip] Slides of my talk: asyncio community, one year later

2015-07-23 Thread Victor Stinner
Hi, Yesterday I gave a talk on the asyncio community at EuroPython (Bilbao), you can find the slides (PDF) at: https://github.com/haypo/conf/raw/master/2015-EuroPython-Bilbao/asyncio-community.pdf Victor

Re: [python-tulip] StreamWriter: detect when the transport got closed

2015-07-15 Thread Victor Stinner
Can it be related to this issue? http://bugs.python.org/issue24539 See the fix: https://github.com/python/asyncio/commit/ce3ad816a2ef9456b4b1c26b99dfc85ea1236811 Victor 2015-07-15 16:38 GMT+02:00 Gustavo Carneiro gjcarne...@gmail.com: I have a simple server that uses asyncio StreamWriter to

[python-tulip] Trollius 2.0 released

2015-07-13 Thread Victor Stinner
Hi, Trollius 2.0 has been released. http://trollius.readthedocs.org/ I built 32 and 64 bits wheel packages for Windows, for Python 2.7, 3.3 and 3.4. Trollius is a portage of the asyncio project on Python 2. Trollius works on Python 2.6-3.5. It has been tested on Windows, Linux, Mac OS X,

[python-tulip] Re: Trollius rewritten on top of asyncio git repository

2015-07-08 Thread Victor Stinner
Oh, sorry I forgot to say the the trollius code lives in the trollius branch. Since the git repository is a fork of asyncio, the master branch is the simply a code of asyncio. Trollius has its dedicated website: https://trollius.readthedocs.org/ Victor 2015-07-09 2:12 GMT+02:00 Victor Stinner

[python-tulip] Trollius rewritten on top of asyncio git repository

2015-07-08 Thread Victor Stinner
Hi, tl;dr please test the new https://github.com/haypo/trollius In january, I had serious issues (1) with Mercurial on the Mercurial repository of Trollius. I was also exhausted to try to convince the OpenStack project to replace eventlet with trollius. In the meanwhile, tulip was renamed to

[python-tulip] Re: Cancellation of asyncio.wait()

2015-04-03 Thread Victor Stinner
if next_message in done: return next_message.result() else: The full recv() method: https://github.com/aaugustin/websockets/blob/7d8191699a6d647c1b45e3e11681c5987437e5b5/websockets/protocol.py#L149 Victor 2015-01-29 10:06 GMT+01:00 Victor Stinner victor.stin...@gmail.com: Hi, While I

Re: [python-tulip] Aiofiles

2015-04-01 Thread Victor Stinner
Hi, Nice project. def sendfile(out, in_fd, offset, nbytes, loop=None, executor=None): IMO you must declare loop and executor as keyword-only parameter to avoid bugs. Victor 2015-04-01 22:33 GMT+02:00 Tin Tvrtković tinches...@gmail.com: Hello, here's a small library I've put together for

[python-tulip] Writing Redis in Python with asyncio: Part 1

2015-03-26 Thread Victor Stinner
James Saryerwinnie wrote an article: http://jamesls.com/writing-redis-in-python-with-asyncio-part-1.html I just saw it in the Python Weekly mailing list. Victor

Re: [python-tulip] Benchmark Python Web production stack: Nginx with uWSGI, Meinheld and API-Hour

2015-03-26 Thread Victor Stinner
Le mercredi 25 mars 2015, Ludovic Gasc gml...@gmail.com a écrit : I've tested the WGSI+Meinheld because is the best, but the flask version is also better than API-Hour+aiohttp.web: WSGI: I don't understand what is WSGI is this bench. Victor

Re: [python-tulip] Async iterators

2015-03-24 Thread Victor Stinner
2015-03-24 2:44 GMT+01:00 Guido van Rossum gu...@python.org: For seekable() I couldn't find any dynamic implemetations, The first call to io.FileIO.seekable() calls lseek(0, SEEK_CUR). It's safer to expect that any file method can block on I/O. If you doubt that syscalls can block, try

Re: [python-tulip] asyncio.Queue and queue.Queue inconsistency

2015-03-19 Thread Victor Stinner
2015-03-19 10:59 GMT+01:00 Martin Teichmann martin.teichm...@gmail.com: All works fine, only when the producer is too fast, the queue fills up and I get an exception. Hum, maybe this is an important issue in your application. The producer should not raise an exception but *wait* until the

Re: [python-tulip] asyncio.Queue and queue.Queue inconsistency

2015-03-18 Thread Victor Stinner
Hi, 2015-03-18 10:31 GMT+01:00 Martin Teichmann martin.teichm...@gmail.com: I'm currently porting code to use asyncio. I realized that queue.Queue and asyncio.Queue are very similar, which helps porting a lot, just one little detail: the exceptions raised by queue.Queue are called Empty and

Re: [python-tulip] Benchmark Python Web production stack: Nginx with uWSGI, Meinheld and API-Hour

2015-03-13 Thread Victor Stinner
2015-03-13 10:07 GMT+01:00 Ludovic Gasc gml...@gmail.com: Yes, I've the same hope with PyPy because I've seen benchmarks like this: https://twitter.com/oberstet/status/550741713762136064 Did you follow the URL to the code?

Re: [python-tulip] Benchmark Python Web production stack: Nginx with uWSGI, Meinheld and API-Hour

2015-03-12 Thread Victor Stinner
Hi, 2015-03-11 22:43 GMT+01:00 Ludovic Gasc gml...@gmail.com: As promised, this is the benchmarks based on your remarks: http://blog.gmludo.eu/2015/03/benchmark-python-web-production-stack.html I really don't understand the round 4. Django+Meinheld: 3992.68 requests/sec and 1,031,238 errors.

Re: [python-tulip] Use asyncio.as_completed()

2015-03-03 Thread Victor Stinner
. Have you thought through the use case? (Admittedly I haven't.) On Tue, Mar 3, 2015 at 11:01 AM, Gustavo Carneiro gjcarne...@gmail.com wrote: On 2 March 2015 at 10:12, Victor Stinner victor.stin...@gmail.com wrote: Hi, To answer Luciano's question on as_completed(), I read the source

Re: [python-tulip] Which other futures my come out of asyncio.as_completed?

2015-03-02 Thread Victor Stinner
Hi, 2015-03-01 13:43 GMT+01:00 Luciano Ramalho luci...@ramalho.org: Note: The futures f are not necessarily members of fs. A given future may be wrapped in another future by as_completed; when that happens, the result/error of the new future will be the same as the original future. I

Re: [python-tulip] Re: Weak UDP support in asyncio

2015-02-26 Thread Victor Stinner
2015-02-26 16:49 GMT+01:00 Antoine Pitrou solip...@pitrou.net: What is your use case? See the code at the end of my message: while True: data, addr = sock.recvfrom() ... I expect a similar syntax using asyncio: while True: data, addr = yield from sock.recvfrom() ... Victor

[python-tulip] Weak UDP support in asyncio

2015-02-26 Thread Victor Stinner
Hi, I'm trying to port a project using eventlet to asyncio, but I don't know how to use UDP. I like asyncio.open_connection() because it makes possible to write sequential code using yield from. UDP doesn't seem to be well supported in asyncio today :-( For example, there are loop.sock_recv()

Re: [python-tulip] Macro-benchmark with Django, Flask and AsyncIO (aiohttp.web+API-Hour)

2015-02-26 Thread Victor Stinner
2015-02-26 8:19 GMT+01:00 Aymeric Augustin aymeric.augus...@polytechnique.org: IMO, the fact that you get so many errors indicates that something is probably wrong in your benchmark setup. It is difficult to believe that Flask and Django would believe so badly in such a simple (almost

Re: [python-tulip] Re: Thread safety

2015-02-26 Thread Victor Stinner
Hi, 2015-02-25 16:23 GMT+01:00 Andrew Svetlov andrew.svet...@gmail.com: I'm OK with current asyncio locks and queue implementation, they are not-threadsafe by design explicitly. Ok, so it's just a documentation issue. It's now fixed: https://hg.python.org/cpython/rev/366e3ad5e3bd Victor

[python-tulip] Thread safety

2015-02-25 Thread Victor Stinner
Hi, On IRC, someone told me that it took him hours to understand that asyncio.Queue is not thread-safe and he expected asyncio.Queue to be thread-safe. I modified the asyncio documentation to mention in almost all classes that asyncio classes are not thread-safe. I didn't touch the doc of lock

Re: [python-tulip] Re: Thread safety

2015-02-25 Thread Victor Stinner
2015-02-25 16:23 GMT+01:00 Andrew Svetlov andrew.svet...@gmail.com: I'm OK with current asyncio locks and queue implementation, they are not-threadsafe by design explicitly. Ok, it expected this answer. It is a more a documentation issue than a design issue :-) For locks you can use `yield

[python-tulip] New #asyncio IRC channel on Freenode

2015-02-25 Thread Victor Stinner
Hi, Since I get more and more questions on asyncio, I chose to create a new IRC channel on the Freenode network: #asyncio. Join us to ask questions, share new articles, etc. My nickname on IRC is haypo. Freenode : https://www.freenode.net/ Victor

Re: [python-tulip] Macro-benchmark with Django, Flask and AsyncIO (aiohttp.web+API-Hour)

2015-02-25 Thread Victor Stinner
Hi, I don't understand everything, but I agree that keep alive has a huge impact on performances. You should compare servers which all support keep alive, or disable keep alive in the client (or disable it on all servers). In a previous job, I backported httplib and xmlrpclib to get keep alive

[python-tulip] Re: OpenStack spec: Replace eventlet with asyncio

2015-02-18 Thread Victor Stinner
Hi, I got more feedback than expected on my asyncio spec for OpenStack. I wrote a third version: https://review.openstack.org/#/c/153298/ I removed unverified information to try to focus on facts. For example, I focused on the correctness rather than trying to convince anyone that asyncio will

[python-tulip]

2015-02-16 Thread Victor Stinner
Hi, Mike Bayer, the author of SQLAchemy, wrote a long article about asyncio and databases: http://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/ IMO the most interesting part if the benchmark written for this article: https://bitbucket.org/zzzeek/bigdata/ The benchmark

Re: [python-tulip] Re: OpenStack spec: Replace eventlet with asyncio

2015-02-11 Thread Victor Stinner
2015-02-11 15:41 GMT+01:00 Andrew Svetlov andrew.svet...@gmail.com: Victor, you benchmark example doesn't use *yield from* statement. As Guido measured two years ago the software stack (built on top of *yield* statements) is 20x times slower than *yield from* for recursive level of 5 or

Re: [python-tulip] Re: OpenStack spec: Replace eventlet with asyncio

2015-02-11 Thread Victor Stinner
2015-02-11 20:22 GMT+01:00 Andrew Svetlov andrew.svet...@gmail.com: Victor, I mean replacing def consume_coroutine(): coro = coroutine(5) try: next(coro) except StopIteration as exc: return exc.value else: raise Exception(StopIteration not raised?)

[python-tulip] OpenStack spec: Replace eventlet with asyncio

2015-02-10 Thread Victor Stinner
Hi, FYI I posted the second version of my specification to replace eventlet with asyncio in OpenStack: https://review.openstack.org/#/c/153298/2/specs/asyncio.rst OpenStack is not the perfect world dreamed by developers, but more the cold and sad real world where the production matters more than

[python-tulip] CPython bugs

2015-02-03 Thread Victor Stinner
Hi, The development of asyncio and trollius helped to identify and fix different bugs in CPython. You may be interested to know them to maybe workaround them if needed. I worked around the gen.send sys.exc_info issues in asynco and trollius. The most recent issue is the sys.exc_info() issue

Re: [python-tulip] Call protocol.connection_lost() when the creation of transport failed?

2015-01-29 Thread Victor Stinner
Hi, 2015-01-29 5:19 GMT+01:00 Glyph gl...@twistedmatrix.com: Twisted always immediately reports the connectionMade to the application-level protocol, so a TLS protocol's connectionMade means the same thing as a TCP protocol's connectionMade. IMO asyncio behaviour is more convinient: only call

Re: [python-tulip] Re: Call protocol.connection_lost() when the creation of transport failed?

2015-01-28 Thread Victor Stinner
2015-01-29 2:47 GMT+01:00 Guido van Rossum gu...@python.org: Doesn't the exception bubble up to the caller of create_connection()? Yes, it does. So what's the problem? The problem is in server which accepts incoming connections: BaseSelectorEventLoop._accept_conncetion(). Extract of the

Re: [python-tulip] Bugfixes in the ProactorEventLoop

2015-01-27 Thread Victor Stinner
about asyncio's stability on Windows. I am now much more confident. On Mon, Jan 26, 2015 at 3:38 PM, Victor Stinner victor.stin...@gmail.com wrote: Hi, I spent last weeks on fixing issues specific to the Windows ProactorEventLoop. Even if the code was working in most cases, sometimes, I

Re: [python-tulip] Best practice for managing loop: don't close it (really!?)

2015-01-19 Thread Victor Stinner
2015-01-19 12:52 GMT+01:00 Luciano Ramalho luci...@ramalho.org: In a non-trivial program, how do I know mine was the first call to get_event_loop? It doesn't matter who called it first. You may even call close() more than once ;-) Just try to be kind, don't close the event loop if something

Re: [python-tulip] Best practice for managing loop: don't close it (really!?)

2015-01-18 Thread Victor Stinner
Le lundi 19 janvier 2015, Luciano Ramalho luci...@ramalho.org a écrit : Can I conclude that in practice, close() should not be called at all unless your own code actually created the loop instead of merely fetching it with asyncio.get_event_loop()? Event loops must be closed. The first call

Re: [python-tulip] co-run co-routines

2014-12-25 Thread Victor Stinner
Hi, How do you run these 2 coroutines? Fantix code should work. But you also should be able to schedule directly the 2 coroutines: loop.create_task(sleepy) loop.create_task(test) By the way, did you see the following example?

Re: [python-tulip] More documentation issues with asyncio (asyncio.queue)

2014-12-22 Thread Victor Stinner
behaves. Thanks for the feedback. Victor 2014-12-18 22:49 GMT+01:00 Paul Sokolovsky pmis...@gmail.com: Hello, On Thu, 18 Dec 2014 22:30:19 +0100 Victor Stinner victor.stin...@gmail.com wrote: 2014-12-18 19:30 GMT+01:00 Paul Sokolovsky pmis...@gmail.com: Remove and return an item from the queue

Re: [python-tulip] Truncated exception tracebacks in trollius (Python 2.x)

2014-12-22 Thread Victor Stinner
Hi, Backporting the whole exception feature to Python 2 is not possible. Develop with Python 3! Since the creation of Trollius, I'm trying the enhance debugging. For example, the latest release of trollius (version 1.0.4) now saves the traceback object in Future.set_exception() to be able to

Re: [python-tulip] More documentation issues with asyncio (asyncio.queue)

2014-12-18 Thread Victor Stinner
2014-12-18 19:30 GMT+01:00 Paul Sokolovsky pmis...@gmail.com: Remove and return an item from the queue. If you yield from get(), wait until a item is available. If you don't yield from get() (which apparently means calling it directly), it won't wait until item is available (but do something

[python-tulip] aiotest: test suite to validate an implementation of the asyncio API

2014-12-12 Thread Victor Stinner
Hi, I wrote a new aiotest project which is a test suite to validate an implementation of the asyncio API: https://pypi.python.org/pypi/aiotest aiotest 0.1 includes a very small test suite: only 15 basic tests. I plan to slowly move or copy more or more tests from the asyncio test suite. While

[python-tulip] Re: aiotest: test suite to validate an implementation of the asyncio API

2014-12-12 Thread Victor Stinner
Le vendredi 12 décembre 2014, Yury Selivanov yselivanov...@gmail.com a écrit : It's such a great idea! Congrats. Thanks. Maybe we should include aiotest to the asyncio package/python stdlib? It doesn't make sense to add aiotest to the stdlib. It moves too slowly and it's not easy to

[python-tulip] aiogevent 0.1: asyncio API on top of gevent

2014-11-25 Thread Victor Stinner
Hi, After the aiogreen project released last week, asyncio API on top of eventlet, I just release aiogevent 0.1: asyncio API on top of gevent: https://pypi.python.org/pypi/aiogevent aiogevent 0.1 does not support gevent used with monkey patching. I'm not sure that it's possible to support it.

[python-tulip] Trollius 1.0.3

2014-11-20 Thread Victor Stinner
Hi, Almost 3 weeks after the previous release, I released a new version of Trollius because it was too annoying to work with Trollius 1.0.2. To develop the new aiogreen project, I'm using Python 2 and Trollius. The problem is that run_until_complete() and other functions looses the original

[python-tulip] Re: Python 3.4.2 released, release of asyncio 3.4.2?

2014-11-20 Thread Victor Stinner
that's identical to the version in the Python 3.4.2 release. I've been busy with work this week -- if you want to do a Tulip release please go ahead. Or I can do it tomorrow. On Thu, Oct 9, 2014 at 3:30 PM, Victor Stinner victor.stin...@gmail.com javascript:_e(%7B%7D,'cvml','victor.stin

[python-tulip] New aiogreen project: asyncio event loop for eventlet

2014-11-19 Thread Victor Stinner
Hi, I wrote a new project called aiogreen: it implements the asyncio event loop API (call_soon, coroutines, create_connection, etc.) with eventlet. It makes possible to write asyncio code in a project currently written for eventlet (ex: OpenStack). = https://bitbucket.org/haypo/aiogreen/ = pip

Re: [python-tulip] New aiogreen project: asyncio event loop for eventlet

2014-11-19 Thread Victor Stinner
2014-11-19 18:03 GMT+01:00 Andrew Svetlov andrew.svet...@gmail.com: Does eventlet support Python 3? I see only python 2.6 and 2.7 in it's setup.py. I tested aiogreen on Python 2.7, 3.3 and 3.5. eventlet supports Python 3 since its version 0.15. With monkey-patching, the Python 3 support is only

Re: [python-tulip] Thanks for BaseEventLoop.create_task() !

2014-11-12 Thread Victor Stinner
2014-11-13 0:18 GMT+01:00 Paul Sokolovsky pmis...@gmail.com: (...) do you think that it might be possible to go step further and allow scheduling a new coroutine by just yielding a generator instance? In other words: (I don't see how it is related to create_task. create_task is nothing new,

[python-tulip] Enhance debugging of asyncio

2014-10-31 Thread Victor Stinner
Hi, We told me that developing async code with asyncio is nice, but it's still hard. IMO there are still places where asyncio don't provide information to debug easily issues. The main issue with async code is that errors only come with the tail of a traceback. I added source traceback to tasks

[python-tulip] Re: Enhance debugging of asyncio

2014-10-31 Thread Victor Stinner
Here is an example: --- import asyncio def bug(): raise Exception(error in bar) @asyncio.coroutine def work2(): yield from [] loop.call_soon(bug) @asyncio.coroutine def work(): yield from work2() def schedule(): loop.create_task(work()) loop = asyncio.get_event_loop()

[python-tulip] Wait until a stream is closed?

2014-10-12 Thread Victor Stinner
Hi, I added 3 examples to show to to register an open sockets in asyncio documentation: add_register() with reader callback: https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio-watch-read-event Protocol:

[python-tulip] Re: Wait until a stream is closed?

2014-10-12 Thread Victor Stinner
Hi again, I also added examples of UDP echo client and echo server: https://docs.python.org/dev/library/asyncio-protocol.html#udp-echo-client-protocol https://docs.python.org/dev/library/asyncio-protocol.html#udp-echo-server-protocol In the UDP echo server example, you have a more concrete

[python-tulip] UDP server, error_receveid and connection_lost

2014-10-12 Thread Victor Stinner
Hi, I added an exampl of UDP server in asyncio documentation: https://docs.python.org/dev/library/asyncio-protocol.html#udp-echo-server-protocol My example is based on Tulip example examples/udp_echo.py. In Tulip example, I see that the MyServerUdpEchoProtocol has error_received() and

[python-tulip] Python 3.4.2 released, release of asyncio 3.4.2?

2014-10-09 Thread Victor Stinner
Hi, Python 3.4.2 has been released. What's the status of Tulip? Can we release a version 3.4.2 too? FYI Trollius 1.0.2 should be synchronized with Python 3.4.2. Victor

Re: [python-tulip] overlapped.c

2014-10-06 Thread Victor Stinner
Hi, 2014-10-06 13:11 GMT+02:00 Donald Stufft don...@stufft.io: My problem with _overlapped is mostly that it required a compiler. I’m idly considering what it’d take to give pip some concurrency and one of the requirements there is that we can’t depend on anything that isn’t in the standard

Re: [python-tulip] Trololio: Trollius compatibility made easy

2014-09-21 Thread Victor Stinner
CloudMagic https://cloudmagic.com/k/d/mailapp?ct=pacv=5.1.5pv=4.4.2 On jue, sep 18, 2014 at 6:32 p.m., Think Kos think...@gmail.com wrote: One for 3.3 would be nice, as asyncio is not in the stdlib. On Monday, September 15, 2014 9:07:56 AM UTC+2, Victor Stinner wrote: 2014-09-14 14:27 GMT+02:00

Re: [python-tulip] Trololio: Trollius compatibility made easy

2014-09-15 Thread Victor Stinner
2014-09-14 14:27 GMT+02:00 Think Kos think...@gmail.com: Having [Trollius] wheel for Windows on Python 3 would be nice. I wrote this note in Trollius documentation: Only wheel packages for Python 2.7 are currently distributed on the Cheeseshop (PyPI). If you need wheel packages for other Python

Re: [python-tulip] Trololio: Trollius compatibility made easy

2014-09-12 Thread Victor Stinner
Hi, 2014-09-08 12:16 GMT+02:00 Think Kos think...@gmail.com: I wrote Trololio, a module that makes writing code for both Tulip and Trollius easy. It addresses [Differences between Trollius and Tulip](http://trollius.readthedocs.org/en/latest/asyncio.html), check it out:

[python-tulip] Fork of Trollius running in Javascript using PyPy.js

2014-09-12 Thread Victor Stinner
Hi, J. D. Bartlett (@jd_bartlett) wrote this on Twitter: @victor_stinner @rfkelly My trollius event loop for pypy.js: http://talljosh.org/pypyjs/ - currently supports only delayed calls. https://twitter.com/jd_bartlett/status/510065679479734273 Demo: http://talljosh.org/pypyjs/ Source code:

Re: [python-tulip] closing event loops

2014-09-10 Thread Victor Stinner
Please, help me to enhance the documentation. Get the documentation source at: http://hg.python.org/cpython/file/5bc23c111de1/Doc/library/asyncio-eventloop.rst And send a patch. Victor 2014-09-10 13:04 GMT+02:00 Martin Teichmann martin.teichm...@gmail.com: Hi again, thanks for all the great

[python-tulip] Task.set_result() and Task.set_exception()

2014-09-03 Thread Victor Stinner
Hi, I saw a strange code in a StackOverflow question: http://stackoverflow.com/questions/23840886/strange-assertionerror-in-asyncio The code wraps a coroutine into a task and later set manually the result of the task. Another coroutine waits on this task. At the exit, the coroutine is not done

Re: [python-tulip] A cancelled task is still pending

2014-08-27 Thread Victor Stinner
Hi, The main message is Task was destroyed but it is pending!, but you should see the status of the task in the lines below: Task cancelling ..., no? I agree that we can improve the main message. It's not obvious that cancelling a task is asynchronous. In fact, the cancellation can be ignored

Re: [python-tulip] Questions regarding loop.create_server() and the Streams API

2014-08-25 Thread Victor Stinner
Hi, 2014-08-25 11:52 GMT+02:00 Martin Richard martius...@gmail.com: The method loop.create_server() allows to use an existing socket, but will however perform a call to listen() on that socket. I am not sure why it's not up the user creating the socket to perform that call. In particular, on

Re: [python-tulip] SSL HandShake / Dynamic Certificates

2014-07-30 Thread Victor Stinner
Hi, 2014-07-30 12:30 GMT+02:00 Imran Geriskovan imran.gerisko...@gmail.com: However, if you need to use dynamic certificates, you must have access to SSL Handshake in async means. But this is not currently supported by asyncio. What is a dynamic certificate? If you want to load a certificate

[python-tulip] Release of Trollius 1.0.1 (bugfix)

2014-07-30 Thread Victor Stinner
Hi, I released the version 1.0.1 of Trollius: http://trollius.readthedocs.org/changelog.html#version-1-0-1 This release supports PyPy and has a better support of asyncio coroutines, especially in debug mode. It also gets enhancements done in Tulip, like enhancements on the IOCP proactor for

Re: [python-tulip] Re: Writing unit tests for user code

2014-07-25 Thread Victor Stinner
2014-07-25 11:30 GMT+02:00 Luca Sbardella luca.sbarde...@gmail.com: Pulsar has an asynchronous testing framework too http://quantmind.github.io/pulsar/apps/test.html It uses the unittest.TestCase class from the standard library but can handle test functions which return generators or

[python-tulip] Release of Trollius 1.0

2014-07-21 Thread Victor Stinner
Hi, I'm very happy to announce the release of Trollius 1.0: https://pypi.python.org/pypi/trollius Yury Selivanov accepted my pull request in greenio to support Trollius and released greenio 0.6: https://pypi.python.org/pypi/greenio So you can now use greenio 0.6 with trollius 1.0 in

Re: [python-tulip] Subprocess, socket pairs and pipes

2014-07-18 Thread Victor Stinner
2014-07-17 19:44 GMT+02:00 Guido van Rossum gu...@python.org: I don't like mapping the exceptions; just document them. Ok, agreed. I do like always using a socket pair. And being able to send EOF reliably sounds good! The patch is simple: http://codereview.appspot.com/115010043 Subprocess:

Re: [python-tulip] How to write network server in coroutine style?

2014-07-18 Thread Victor Stinner
Hi, Here is a very basic example to show how to use start_server(). echo_server() coroutines will run in parallel. --- import asyncio @asyncio.coroutine def echo_server(reader, writer): line = yield from reader.readline() print(Reply %r % line) writer.write(line) yield from

[python-tulip] Subprocess, socket pairs and pipes

2014-07-17 Thread Victor Stinner
Hi, I have a few questions about subprocesses, socket pairs and pipes. (1) use pipe() for stdin in _UnixSubprocessTransport? asyncio creates a socket pair for subprocesses instead of a classic pipe on UNIX. On AIX it is not possible to listen for read event on the write end of a pipe to be

Re: [python-tulip] Why is SIGINT ignored on Windows while asyncio event loop is running?

2014-07-16 Thread Victor Stinner
Hi, 2014-07-16 10:58 GMT+02:00 Arve Knudsen arve.knud...@gmail.com: Using Python 3.4.1 on Windows, I've found that while executing an asyncio event loop, programs ignore SIGINT. The workaround is to periodically wake up the event loop, so that SIGINT can be processed. Is this behaviour

Re: [python-tulip] Why is SIGINT ignored on Windows while asyncio event loop is running?

2014-07-16 Thread Victor Stinner
I created a task as a reminder: https://code.google.com/p/tulip/issues/detail?id=191 FYI I also created a task to implement datagram protocols on Windows with the proactor event loop: https://code.google.com/p/tulip/issues/detail?id=187 Victor 2014-07-16 14:21 GMT+02:00 Victor Stinner

Re: [python-tulip] catching errors in create_server

2014-07-15 Thread Victor Stinner
that a change is required in Trollius. Victor 2014-07-15 8:13 GMT+02:00 Victor Stinner victor.stin...@gmail.com: Hi, You described the PEP 3151 which has been implemented in Python 3.3: https://www.python.org/dev/peps/pep-3151 In Python 3.3, socket.error is an alias to OSError. In Trollius, I'm

Re: [python-tulip] New debug log on socket events

2014-07-14 Thread Victor Stinner
: This is awesome! At various times I've hacked the asyncio source code to insert print statements to debug a nasty problem. This is so much better!! On Fri, Jul 11, 2014 at 6:45 PM, Victor Stinner victor.stin...@gmail.com wrote: Hi, I commited a change to log most important socket events. I added

Re: [python-tulip] cancellation of `TimerHandle`s and freeing references

2014-07-10 Thread Victor Stinner
Hi, Guido reviewed my patch, I commited it: https://code.google.com/p/tulip/issues/detail?id=186 Thanks for the suggestion chrysn, it was a good idea ;-) Victor 2014-07-05 0:37 GMT+02:00 Victor Stinner victor.stin...@gmail.com: Hi, Here is patch for Handle: http://codereview.appspot.com

Re: [python-tulip] Tulip, Trollius and greenio: add asyncio.tasks.task_factory

2014-07-08 Thread Victor Stinner
2014-07-08 14:57 GMT+02:00 Luca Sbardella luca.sbarde...@gmail.com: greenio also has its own event loop policy and event loop, so the loop.create_task() method is enough. yes, that works too. Great :-) I pushed my change adding a new create_task() method. Victor

[python-tulip] Update of the asyncio documentation

2014-07-08 Thread Victor Stinner
Hi, I updated the asyncio doc according to last developments, especially the new create_task() method: - Document the new create_task() method - Hide the Task class: point to the create_task() method for interoperability - Rewrite the documentation of the Task class - Document the Pending task

Re: [python-tulip] Tulip, Trollius and greenio: add asyncio.tasks.task_factory

2014-07-07 Thread Victor Stinner
Hi, Did you see the 3rd version of my patch? It adds EventLoopPolicy.get_task_factory() which is called by BaseEventLoop constructor: https://codereview.appspot.com/110820049/ See also the issue: https://code.google.com/p/tulip/issues/detail?id=185 Does the Pulsar Task class inherit from

Re: [python-tulip] Tulip, Trollius and greenio: add asyncio.tasks.task_factory

2014-07-07 Thread Victor Stinner
2014-07-07 17:50 GMT+02:00 Guido van Rossum gu...@python.org: I'm not sure actually. Does Task have any public methods that it doesn't inherit from Future? I think the more fundamental *interface* is Future, while Task (mostly) provides a specific implementation. Task has more attributes:

  1   2   >