A simple introduction to Python’s asyncio

Unknown Reply 3:08 PM

Python asyncio

An article by Apoorv Garg on hackernoon.com gives a simple introduction to Python’s asyncio.

He writes:

Why do we want to write asynchronous programs you say — because it could increase the performance of your program many many times. Imagine you have a single core machine you are running your app on. You receive a request, and you need to make two database queries to fulfil that request. Each query takes 50ms of time. With a synchronous program, you would make the second request only after completing the first — total time 100ms. With an asynchronous program, you could fire off both the queries one after the other — total time 50ms.

asyncio

Asyncio is all about writing asynchronous programs in Python. Asyncio is a beautiful symphony between an Event loopTasks and Coroutines all coming together so perfectly — it’s going to make you cry.

You can read the full article here.

code + comm

Post a Comment

O.O
-"-
(*.*)
*-*
="=
o"o?
(T_T)
(--;)
:^D^:
:@v@:
-.-b
(==)
(oxO)
o(O
(--)z
(*0*)
^q^
(o_o)
*_`
**"

Search

Follow us

Popular Reviews