[python-tulip] A cancelled task is still pending

2014-08-05 Thread Martin Richard
Hi, When cancelling a task outside of the loop, the task is still considered pending because the result (CancelledError) will only be set when the loop will try to run the task once more. In the current version of tulip (last revision from 30 July), a consequence of this is that the message "T

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

2014-08-06 Thread Martin Richard
ng this warning in the logs. Maybe we could make it clearer by > logging a different message when _must_cancel is set? > > > On Tue, Aug 5, 2014 at 4:27 AM, Martin Richard > wrote: > >> Hi, >> >> When cancelling a task outside of the loop, the task is still consi

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

2014-08-25 Thread Martin Richard
Hi, 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 Linux (I don't know for others systems), it will change the backlo

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

2014-08-25 Thread Martin Richard
On Monday, August 25, 2014 2:03:36 PM UTC+2, Victor Stinner wrote: > > Hi, > > It's probably a bug. > Ok, should I open an issue? > > I also have questions about StreamWriter and the flow control system. > > > > I understood that I am expected to yield from writer.drain() after any > call

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

2014-08-26 Thread Martin Richard
On Monday, August 25, 2014 8:31:04 PM UTC+2, Guido van Rossum wrote: > > On Mon, Aug 25, 2014 at 6:25 AM, Martin Richard > wrote: > >> On Monday, August 25, 2014 2:03:36 PM UTC+2, Victor Stinner wrote: >>> >>> Hi, >>> >>> It's probably

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

2014-09-06 Thread Martin Richard
On Wednesday, August 27, 2014 6:56:59 PM UTC+2, Guido van Rossum wrote: > > On Tue, Aug 26, 2014 at 2:04 AM, Martin Richard > wrote: >> >> >> I would have thought that the backlog argument would have been used only >> when host and port are provided. But

[python-tulip] aiotest: a testing library on top of unittest for asyncio

2015-05-11 Thread Martin Richard
Hi, I would like to talk about a testing library I wrote on top of unittest called aiotest. The goal is to provide a package compatible with the standard unittest package, but which cuts the boilerplate when testing asyncio code. The code is on github here: https://github.com/Martiusweb/aiotes

Re: [python-tulip] aiotest: a testing library on top of unittest for asyncio

2015-05-12 Thread Martin Richard
bitbucket.org/haypo/aiotest/ already present on PyPI: > https://pypi.python.org/pypi/aiotest > > I should suggest to rename your library to avoid comprehension errors from > newcomers. > > Have a nice night. > > -- > Ludovic Gasc (GMLudo) > http://www.gmludo.eu/ > >

Re: [python-tulip] aiotest: a testing library on top of unittest for asyncio

2015-05-12 Thread Martin Richard
hoose the Proactor event loop, for instance), I can add the option to disable the default loop. 2015-05-12 12:10 GMT+02:00 Andrew Svetlov : > Hmm. I always prefer to disable default event loop in tests by > `asyncio.set_event_loop(None)` call. > > On Tue, May 12, 2015 at 10:09 AM, Martin

Re: [python-tulip] Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread Martin Richard
Hi, I think that when you configure the logging, the exception is logged when the program terminates as the exception was never retrieved explicitly. When you don't configure the logging system, the exception is still logged, but not printed as the logger is not told to do so. wait() returns a pa

Re: [python-tulip] Re: Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread Martin Richard
done.result() should raise an AttributeError (as you should have wrote task.result()). When the logger is disabled, task.result() raise the exception. The mistake is somewhere in your configuration of the logging system: it suppresses the output of the exception. For instance, when I call logging.

Re: [python-tulip] Discussion thread for: http://lucumr.pocoo.org/2016/10/30/i-dont-understand-asyncio/

2016-10-31 Thread Martin Richard
Hi, Like Justin, I'm happily using asyncio for 3 years now. After discussing with people during pycon-fr and a colleague who just started working on asyncio, I'd like to share a few thoughts I collected (and hope I won't make things more confusing). I have the feeling that new users can not under

Re: [python-tulip] Explicit vs Implicit event loop

2016-10-31 Thread Martin Richard
Hi, Indeed, for applications, I believe that we should rather depend on defining the right EventLoopPolicy (or use the default one if most cases) and call get_event_loop() when required rather than passing the loop explicitly. Most of the time a policy is sufficient to describe how your applicatio

Re: [python-tulip] Explicit vs Implicit event loop

2016-11-08 Thread Martin Richard
On Monday, October 31, 2016 at 9:49:48 PM UTC+1, Yury Selivanov wrote: > > > Awesome! I’ll reopen that PR in a couple of days. > > Thank you, > Yury Hi, now that the PR is merged, would like to update asynctest for python 3.6, and I'd like your advice about how get_event_loop() should now

Re: [python-tulip] Explicit vs Implicit event loop

2016-11-08 Thread Martin Richard
the loop (run_in_executor(), getaddrinfo()), since they are methods of the loop instance, I guess it's fine. 2016-11-08 19:18 GMT+01:00 Yury Selivanov : > > > On 2016-11-08 11:07 AM, Martin Richard wrote: > >> - the feature is left as it is: a library author should no longer have to &

Re: [python-tulip] Explicit vs Implicit event loop

2016-11-08 Thread Martin Richard
2016-11-08 22:00 GMT+01:00 Guido van Rossum : > But they could also call it before a loop is active and then call > run_until_complete() on the thing. E.g. > > f = sleep1() # definition from my previous post > asyncio.get_event_loop().run_until_complete(f) > > Assuming that's the only get_event_l

Re: [python-tulip] multiprocessing issue with python 3.6

2016-12-28 Thread Martin Richard
Hi Denis, We are talking about forking without exec-ing right after, so using subprocess coroutines is mostly fine. It's dangerous because you may: 1/ run scheduled code (callback, task, etc) twice, 2/ interfere with the parent loop from the child by mistake. 1/ you can't really know if the loop