Implementing new eventloops

64 views
Skip to first unread message

Ronald Oussoren

unread,
Oct 29, 2017, 7:48:57 AM10/29/17
to python-tulip
Hi,

Is there documentation on how to implement new eventloops for asyncio? In particular, I intend to write an eventloop implementation for a GUI library (PyObjC).

Ronald

Guido van Rossum

unread,
Oct 29, 2017, 2:46:58 PM10/29/17
to Ronald Oussoren, python-tulip, Yury Selivanov
That's a great idea. I don't think we have docs for this, but the source of the event loop is pretty accessible. Yury has implemented a replacement event loop in C (or was it C++?), "uvloop" so he probably has a more useful answer.
--
--Guido van Rossum (python.org/~guido)

Andrew Svetlov

unread,
Oct 30, 2017, 3:26:27 AM10/30/17
to gu...@python.org, Ronald Oussoren, python-tulip, Yury Selivanov
Also there is a well supported https://github.com/harvimt/quamash project for running asyncio on Qt event loop.
--
Thanks,
Andrew Svetlov

Ronald Oussoren

unread,
Nov 2, 2017, 2:36:02 PM11/2/17
to Andrew Svetlov, gu...@python.org, python-tulip, Yury Selivanov
Thanks.  I already expected that I’d have to look the source code, and having different implementations to look at will definitely help.

Ronald

Nathaniel Smith

unread,
Nov 2, 2017, 6:08:47 PM11/2/17
to python-tulip
[Re-sending this to just the list in an attempt to appease Google
Groups; apologies for any duplicates.]

On this subject, one thing that would also be really useful is some
kind of shared test suite. I know there's Victor's aiotest, and we're
using it in trio-asyncio [1], but I'm not sure how reliable it
actually is, given that it mostly hasn't been touched since 2014 and
afaict asyncio itself doesn't use it. OTOH CPython's
Lib/test/test_asyncio/ is presumably reliable since it's maintained
and used, but I don't know how to use it to test a third party event
loop.

I'd love to hear what strategies other third party loops are using.

-n

[1] https://github.com/python-trio/trio-asyncio
--
Nathaniel J. Smith -- https://vorpus.org

Tamás Bajusz

unread,
Dec 14, 2017, 6:08:52 AM12/14/17
to python-tulip
On Sunday, October 29, 2017 at 12:48:57 PM UTC+1, Ronald Oussoren wrote:
Hi,

Is there documentation on how to implement new eventloops for asyncio? In particular, I intend to write an eventloop implementation for a GUI library (PyObjC).

You may be interested to read this also: Integrate tkinter and asyncio (and async)
Reply all
Reply to author
Forward
0 new messages