Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python asyncio training exercises

Feeling the need to learn how to use asyncio, but cannot think of applicable problem (or problem set) that can help me learn this new technique.

Could you suggest a problem that can help me understand and learn asyncio usage in practice?

In another words: can you suggest me an example of some abstract problem or application, which, while coding it, will help me to learn how to use asyncio in practice.

Thank you

like image 820
Xeizzeth Avatar asked Jul 27 '17 12:07

Xeizzeth


1 Answers

Any I/O bound task would be a good case for asyncio. In the context of the network programming - any application, that requires simultaneous handling of the thousands of connections. Web server, web crawler, chat backend, MMO game backend, torrent tracker and so on. Keep in mind, though, that you should go async all the way and use async versions of all libraries performing blocking I/O, like the database drivers, etc.

like image 165
atihonruk Avatar answered Nov 15 '22 10:11

atihonruk