Somebody who knew Python asked me what an event loop was, and instead of rambling in a text box I decided to ramble in a video.
I'm not sure why this is a popular video! I was answering one person't question and the video doesn't make much sense outside of this context.
In this video we write a little chat client in Python that needs to use two different blocking calls concurrently: reading a line of user input and reading messages from a server. How can we do two "blocking" things (waiting for the user to type and waiting for messages to come in over the wire) at once? Should we switch to nonblocking apis for both of these, and just poll for each and switch between them really fast? No! Let's block on both of them at the same time with select! Then draw the rest of the owl and tada, an event loop!
Watch video Getting started with event loops: the magic of select online without registration, duration hours minute second in high quality. This video was added by user Thomas Ballinger 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 21,515 once and liked it 286 people.