Re: [python-tulip] How am I supposed to handle asyncio.CancelledError on a Future?

2015-04-09 Thread Rémy Hubscher
Ok so continuing to investigate, my question is summarize by the following: #!/usr/bin/env python import asyncio import hiredis from aioredis.util import encode_command from aioredis.errors import ProtocolError, ReplyError @asyncio.coroutine def run_me(): reader, writer = yield from

Re: [python-tulip] How am I supposed to handle asyncio.CancelledError on a Future?

2015-04-09 Thread Rémy Hubscher
Ok so to end this thread, @popravich https://github.com/popravich told me that the problem is on the server side, since cancelling reader.read() doesn't actually stop the server from waiting for the request. For the BLPOP timeout case, we should probably let the redis server handle the timeout

Re: [python-tulip] How am I supposed to handle asyncio.CancelledError on a Future?

2015-04-09 Thread Rémy Hubscher
I tried to use reader.feed_data() for that but the next call to yield from reader.read() return the data feeded. Le jeudi 9 avril 2015 15:33:29 UTC+2, Rémy Hubscher a écrit : Ok so continuing to investigate, my question is summarize by the following: #!/usr/bin/env python import asyncio

[python-tulip] How am I supposed to handle asyncio.CancelledError on a Future?

2015-04-08 Thread Rémy Hubscher
Hello, I am using aioredis on a BLPOP which is a blocking call on a redis connection. redis.blpop is a Future created here: https://github.com/aio-libs/aioredis/blob/master/aioredis/connection.py#L154-L157 When using asyncio.wait_for(redis.blpop(channel), timeout=5) if the timeout is raised

Re: [python-tulip] How am I supposed to handle asyncio.CancelledError on a Future?

2015-04-08 Thread Rémy Hubscher
It is also what Victor Stinner said at first, but I am quite sure it is. Also I proposed to inherit from Future to improve the cancel() call and made this patch: https://github.com/aio-libs/aioredis/pull/59/files Could you tell me if it is the right way to do it? Le mercredi 8 avril 2015