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

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Python asyncio: Summary & Recap

Give Feedback

Recap of everything you’ve covered in this course. In this course, you learned:

  • What asyncio is and when you can use it in your projects
  • How to set up a project
  • What generators are
  • What coroutines are
  • How to use asyncio to build a real world application

00:00 Congratulations on finishing! Now that you’re done, what I’d like to do is go back over the objectives. So, number one, what is asyncio? Once again, I mentioned that asyncio is a library in Python that’s used in case you have an IO bound-application—you have an app and it’s slow and it’s slow because you’re doing a lot of IO.

00:20 You’re talking to a database, you’re talking to a file system, you’re talking to some website and it’s slow. asyncio can definitely help the performance with that.

00:27 We set up this project together, I showed you what generators are using the yield keyword. We set up coroutines, which are similar to generators. Remember, generators are producers; coroutines are like consumers.

00:40 Coroutines are asynchronous, you have to use the async keyword and also await—the async/await keywords.

00:47 And then asynchronous generators are generators that produce values,

00:51 but produce them asynchronously, so you don’t know how often that they will actually produce those values. And those async generators are a combination of generators and coroutines. Then finally, we built a real-world application, which went out to some website and requests n number of random numbers from this website, and then brought it back and then used it in our application.

01:13 But we created, I think, nearly 30 coroutine tasks that seemed to run essentially in parallel, and our speed on it was actually really fast, versus something that, if you were to do them sequentially one after the other after the other, would have been a lot slower.

01:29 So, hopefully, this tutorial helped you out with asyncio and maybe it gave you some ideas of how you can use asyncio in your project to increase your performance. Thank you.

sion on April 23, 2019

This truly helped me understand asyncio. Also, I picked up tips along the way. Not least the presentation was excellent. Thank you.

Paul on June 17, 2019

Very well done presentation. Tied together many concepts in concise examples. This will serve as a template. Thanks.

Miguel Garcia RP Team on Sept. 19, 2019

Awesome, very nice and clear explanations and examples. Thanks!

marktompkins on Dec. 10, 2019

Excellent job! Well done!

Marc Mueltin on Jan. 24, 2020

Amazing presentation, thank you so much. Very well explained.

Hilman on Feb. 8, 2020

Amazing, amazing, amazing! Thank you!

sundarauj on April 18, 2020

Very good presentation

arunshankarc on April 28, 2020

Amazing !!

teja reddy on May 25, 2020

Great!!- Very clear demo to quick start with asyncio.

mahlenius on June 30, 2020

Great job explaining this asycnio lib. Enjoyed the demos and actually typed along with them so I could try/tinker myself. The “real world” example at the end was very useful for me. Thanks!

techdiverdown on July 13, 2020

Very well done, i enjoyed the presentation and I learned some things. The last example was useful.

Sid Price on July 25, 2020

Clear and concise … thank you

Ghani on Oct. 30, 2020

Very good course; thank you!

ulascilingir on Dec. 6, 2020

Thank you, great help on asyncio!

Become a Member to join the conversation.