Session

The Hitchhiker's Guide to asyncio

asyncio is the de-facto standard for asynchronous programming in Python and enables concurrent operations without using threads or processes.

In this talk, we will delve into the technical details of asyncio and show how it can be used to improve the performance of Python applications. We will start by discussing the difference between threading, multiprocessing and async programming. Then, we will introduce the basic building blocks of asyncio: Event loops and Coroutines. We will dive deep into the way Coroutines work, discussing their origins and how they are linked to Generators.

Next, we will look at Tasks, which are a higher-level abstraction built on top of Coroutines. Tasks make it easy to schedule and manage the execution of Coroutines. We will cover how to create and manage Tasks and how they can be used to write concurrent code.

Finally, we will also cover some more advanced topics such as Async Loops and Context Managers, and how to handle errors and cancellations in asyncio.

First delivered at Python Milan, 8 March 2023, Milan, Italy
Held also at PyCon Italy, 24-28 May 2023, Florence, Italy
Recorded session at https://www.youtube.com/watch?v=UyRj8Sh3E_Y

Emanuele Fabbiani

Head of AI at xtream

Milan, Italy

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top