© Mohamed Mustapha Tahrioui 2019
M. M. Tahriouiasyncio Recipeshttps://doi.org/10.1007/978-1-4842-4401-2_10

10. Preventing Common Asyncio Mistakes

Mohamed Mustapha Tahrioui1 
(1)
Darmstadt, Hessen, Germany
 

Asyncio comes with mistakes of its own. For example, you can forget to await a coroutine, write code that is blocking for too long, or run into data races and deadlocks. Errors can occur inside scheduled tasks, coroutines, and event loops. All of this-in addition to the complexity of learning new APIs and concepts like coroutines and event loops-can discourage people from using asyncio. In this chapter, we learn about common places where mistakes are made and how to pinpoint them, the standard asyncio ways of handling exceptions, and how to craft ...

Get asyncio Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.