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

2015-03-03 Thread Guido van Rossum
I looked a bit more. The only thing that ever waits is the caller in the for-loop (for f in as_completed(...): x = yield from f; ...). It will always wait for _wait_for_one(), which in turn will always wait for done.get(). So if the above yield-from is cancelled, _wait_for_one() is cancelled,

Re: [python-tulip] Adding datagram-like protocol (zigbee) not over socket (serial port), design advice needed

2015-03-03 Thread Nicolas Di Pietro
Here is my code to read the serial port with asyncio: https://gist.github.com/potens1/914b738a2ca6fed7a7b3 This is quick and dirty but it can give ideas and if someone else is googling on how to read/write serial port with asyncio, it can give ideas Have a nice day, Nicolas 2015-03-03 23:39

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

2015-03-03 Thread Guido van Rossum
On Tue, Mar 3, 2015 at 2:06 PM, Luciano Ramalho luci...@ramalho.org wrote: On Tue, Mar 3, 2015 at 1:49 AM, Guido van Rossum gu...@python.org wrote: It's exceedingly subtle -- that's why the docstring contains an example of how to use it. Note the final two lines: for _ in

Re: [python-tulip] Adding datagram-like protocol (zigbee) not over socket (serial port), design advice needed

2015-03-03 Thread Guido van Rossum
On Tue, Mar 3, 2015 at 2:39 PM, Nicolas Di Pietro pote...@gmail.com wrote: Hi Guido, Thank you for taking some time to answer this. 2015-03-03 6:05 GMT+01:00 Guido van Rossum gu...@python.org: I'll try to give some hints on Nicolas's original question. I agree with Luciano that posting

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

2015-03-03 Thread Gustavo Carneiro
On 3 March 2015 at 19:34, Guido van Rossum gu...@python.org wrote: I looked a bit more. The only thing that ever waits is the caller in the for-loop (for f in as_completed(...): x = yield from f; ...). It will always wait for _wait_for_one(), which in turn will always wait for done.get(). So

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

2015-03-03 Thread Victor Stinner
I never used as_completed() and I still learn how to use it. So it cannot explain how I plan to use it :-) Victor Le 3 mars 2015 20:34, Guido van Rossum gu...@python.org a écrit : I looked a bit more. The only thing that ever waits is the caller in the for-loop (for f in as_completed(...): x =