AsyncIO from the bottom up: building it from scratch with generators

Kaustubh Maske Patil (~nikochiko)


3

Votes

Description:

AsyncIO is Python's way of making things faster. It is much much more performant than non-concurrent Python when dealing with I/O tasks such as requesting a webpage over HTTP or reading and writing files to disk. The API however is a bit tricky, and you need to be aware of the pitfalls and APIs to make proper use of it. In this talk, we'll attempt to understand that in depth by diving deep into how asyncio was built. The destination is sweet, but for us to get there the journey must also be fun and interesting. That's why when we make our way from generators to coroutines to event loops, we'll take a few detours to explore fun things such as infinite sequences and synchronising beats with coroutines. Of course, by the end of talk, you will be able to confidently make use of asyncio's powers, and make your data pipelines and servers faster by as much as 10 times. You will also walk away with a clear understanding of the idea of cooperative multitasking, and why similar ideas are also popular in other programming languages (Go, JavaScript, OCaml, ...).

Prerequisites:

  • Basic Python
  • Knowing that something called asyncio exists

Speaker Info:

Kaustubh is a self-taught programmer. He likes to tinker around with things, and subscribes to the idea of unschooling -- to learn from curiosity. He has been working in the industry for about 3 years, and been involved in open source projects for longer. He loves self-hosting his tech setup and plays chess sometimes. He is interested in how programming languages are implemented, Python's internals, and functional programming. He was also a Google Code-in winner in 2019, and is contributing to PostgreSQL as part of Google Summer of Code in 2023. He has also written a few blogs about Python.

Section: Core Python
Type: Talks
Target Audience: Intermediate
Last Updated: