Re: [python-tulip] Get status of loop.call_later call

2015-05-07 Thread coles.da...@gmail.com
Hi Alexander, I don't believe there's any way which which you can check the result of a callback from the Handle. You would have to use something like a Future passed into your callback. You can also use this future to capture any potential exceptions thrown in the callback. def callback(arg,

Re: [python-tulip] Cleanly shutting down a streams server

2015-05-05 Thread coles.da...@gmail.com
ng for > "except Exception" in the asyncio code base that match your traceback. > > On Tue, May 5, 2015 at 2:23 PM, coles.da...@gmail.com > wrote: >> >> When trying to shutdown a streams based server I often get a "Task was >> destroyed but it is pe

[python-tulip] Cleanly shutting down a streams server

2015-05-05 Thread coles.da...@gmail.com
When trying to shutdown a streams based server I often get a "Task was destroyed but it is pending!" error and haven't been able to find a way to fix it. I've been able to reproduce this using the "TCP echo server using streams" example in the Python docs

Re: [python-tulip] Running multiple servers in one event loop

2015-01-18 Thread coles.da...@gmail.com
Yup. It definitely can. Just use loop.run_until_complete(asyncio.create_server(...)) or loop.run_until_complete(asyncio.start_server(...)) as many times as you need before calling loop.run_forever(). Here's a short example that runs a TCP server listening on three different ports (very similar to

Re: [python-tulip] asyncio.wait_for and Condition

2014-11-22 Thread coles.da...@gmail.com
On Thu, Nov 20, 2014 at 5:37 PM, David Coles wrote: > > My current workaround is to roll my own condition timeout-cancellation logic, > but it really seems like wait_for and Condition should be able to play nicer > together. Seems like this isn't quite sufficient by itself. There's a race condi