Asynchronous programming :: far beyond to traditional approach of programming
Here are many approach to do a programming.We solve a real world problem by programming.So,we need a memory efficient,fast solution,but in the synchronous programming we can not do much about this. As the program/requests do in a linear way,after a request and response to this program completed then second task starts. in this way the this type of programs takes much more time and make it slow.
give a sample picture how it is going under the flow. all subtasks is linearly stay in a main task body.But in Asynchronous programming also can be said as parrallal programming these subtasks seperated from the main task body and make the programs running more fast.
let's take a example: instead of waiting for an HTTP request to finish before continuing execution, with Python async coroutines you can submit the request and do other work that’s waiting in a queue while waiting for the HTTP request to finish.
the node.js be a great server-side programming language for this asynchronous programming. As soon as you ask for any of these resources, your code is waiting around with nothing to do. With asynchronous programming, you allow your code to handle other tasks while waiting for these other resources to respond which make your code much faster and make it more memory efficient.
So,in this way we can use asynchronous programming as a very nice style of programming to make all of us more efficient programmer.
I suggest to check this great article of medium which also inspire me and give understandings in this interested topic : https://medium.com/velotio-perspectives/an-introduction-to-asynchronous-programming-in-python-af0189a88bbb
- resources i used: a introduction to asynchronous programming
thank you,have a great day and make programming fun.