I suspect it never worked, or only with a private variant of Tulip
developed by Dino and Steve Dower, a long time ago, when Steve was arguing
for yield instead of yield-from. I believe I have a version in a private
scratch directory too somewhere. it would be good to revive this for real,
but It would probably be a pretty big project, and Dino's code would at
best be useful to glean some tricks from...

On Friday, May 16, 2014, Victor Stinner <[email protected]> wrote:

> Hi,
>
> Ádám Szieberth contacted me privately to notify me that
> "asyncio_tkinter" does not work. I host this project in this
> repository:
> https://bitbucket.org/haypo/asyncio_staging
>
> The code was written by Dino Viehland for a talk, I just updated the
> code for the new asyncio API (ex: import tulip => import asyncio).
>
> Is there anyone interested to fix the code?
>
> Adam wrote that the following line in tkapp.py :
>    self.button["command"] = self.do_count
>
> must be replaced with:
>    self.button["command"] = lambda: asyncio.Task(self.do_count())
> or
>    self.button["command"] = functools.partial(asyncio.Task,
> self.do_count())
>
> But it's not enough.
>
> guievents.py contains a class which inherits from AbstractEventLoop
> and I see a lot of private code copied from asyncio, like
> run_in_executor(). This code uses privates classes like Handle,
> whereas Handle API has changed.
>
> I'm not sure that I understood the design. asyncio event loop and Tk
> main loop are both running in the same thread? The code uses at least
> two pools of threads.
>
> It looks like the Tk loop must run in the main loop. Why not using a
> standard asyncio event loop in a dedicated thread with
> call_soon_threadsafe()?
>
> Victor
>


-- 
--Guido van Rossum (on iPad)

Reply via email to