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

2016-11-04 Thread Vincent Michel
On Tuesday, November 1, 2016 at 6:46:12 PM UTC+1, Andrew Svetlov wrote: > The same problem is present in asyncio classes itself: Lock, Queue, > streams could be created with global life time and they are will hang if > used from different loop. > Since PR #303

Re: [python-tulip] Yielding a future boud to different loop incidentally

2015-12-11 Thread Vincent Michel
; >> > On Dec 10, 2015, at 4:47 AM, Vincent Michel > > wrote: >> > >> > > Does setting PYTHONASYNCIODEBUG=1 complain about these mistakes? >> > >> > No it doesn't, unless the other loop is also running but that's only >> because `as

Re: [python-tulip] Yielding a future boud to different loop incidentally

2015-12-10 Thread Vincent Michel
> Does setting PYTHONASYNCIODEBUG=1 complain about these mistakes? No it doesn't, unless the other loop is also running but that's only because `asyncio.sleep` calls `future._loop.call_later` before yielding the future. `_check_thread` checks that `call_soon` and `call_at` are not called from a

[python-tulip] Yielding a future boud to different loop incidentally

2015-12-09 Thread Vincent Michel
Hi all, I recently realized that when a future is yielded, `Task._wakeup` is added as a done callback without checking that their loops are the same. That means that `Task._wakeup` might end up being called in the future loop instead of its own loop, which seems wrong. Is there a reason not to

Re: [python-tulip] Asynchronous console and interfaces

2015-12-04 Thread Vincent Michel
> At the end, you got the idea. > It is readable, portable, generic, etc, etc.. > "This" should be underlined in asyncio documentation. > Not the protocols, callbacks, futures, transports... I think they're all very different objects: - callbacks, futures and coroutines are the core of asyncio;

[python-tulip] Asynchronous console and interfaces

2015-12-03 Thread Vincent Michel
Hi all, Last month I've been playing with asyncio and I ended up writing an asynchronous console. It's a python console just like the one in the 'code' module, but running in an asyncio event loop instead. That means it lets you interact with the program environment while it's running other as