PyCon LT 2022

Await for it: mixing async and blocking code
2022-05-27 , Main Room

Tips and tricks to properly mix async code with blocking code, using modern libraries, and taking advantage of the new concurrency features of the language while keeping compatibility with already existing code and libraries.

It will include the basics of what concurrency is, how to take advantage of it in the simplest use cases, and how to safely mix it with regular code.


You've heard async is great, it can improve concurrency performance, but you might have heard that you need to use only async code and use only async-compatible libraries... but the good news is, that's not entirely true.

So, how can you take advantage of these new async features in your current projects that already use blocking code and require some blocking libraries?

In this talk, I'll show you the basics of writing concurrent async code, and how to properly mix it with regular code without affecting performance (without blocking the event loop) by using thread workers underneath. All done in a simple and convenient way using modern libraries.


What topics define your talk the best?:

python, open source, web dev, best practices

Hey! 👋 I'm Sebastián Ramírez (tiangolo), the creator of FastAPI, Typer, SQLModel, Asyncer, and other open source tools.

I'm currently a Staff Software Engineer at Forethought while also helping other companies as an external consultant. 🤓