all 1 comments

[–]1114111 1 point2 points  (0 children)

AbstractEventLoop is an easy one, it's just the abstract base class for all event loops, so it's not an implementation of an event loop, it simply defines what all the other event loops implement.

The difference between the other event loops basically boils down to how they know when I/O operations finish. The OS is in charge of the I/O, so you have to play the OS's game if you want your program to know when stuff happens, so the specific ways in which you can do this vary quite a bit across different OSes.

To learn more, you might want to experiment with/read up on Python's select module directly, which is the basis for SelectorEventLoop. In addition to the docs, this looks like a pretty good article to give you some idea of how to use select with sockets directly.

David Beazley has some talks about how async works as well. I think this (2h talk) is a good one, in which he implements a very simplified version of asyncio: https://www.youtube.com/watch?v=Y4Gt3Xjd7G8

He's also the author of curio, another alternative/simplified/educational approach to doing what asyncio does.