Preventing Common Asyncio Mistakes

Mohamed Mustapha Tahrioui · Apress eBooks · 2019

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 our own solutions when no corresponding asyncio API is available.

Read the paper · More papers on PaperTik