Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

The asyncio Event Loop

Give Feedback

In this lesson, you’ll learn about the Event Loop. You’ll see what it is and how to define one. The Event Loop is used to:

  • perform IO tasks
  • run asynchronous tasks
  • run callbacks

In addition to learning about what it is, you’ll see how to change a normal main() function into an event loop. You’ll see how to create numerous coroutines using Future objects and gather(). In the last section of the lesson, you’ll see an example demonstrating how using an asynchronous approach can make your code run faster.

Comments & Discussion

Become a Member to join the conversation.