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

Reply via email to