O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous

In most programming languages, I/O operations are performed synchronously. Synchronous execution will block the program flow until the blocking operation finishes its execution. For example, the following Python code is executed synchronously and blocks the execution:

file_content = open("my_file.txt") // takes 10 secondsfile_content_2 = open("my_other_files.txt") // takes 20 secondsprint file_contentprint file_content_2   

The total execution time will be approximately 30 seconds. That is because of the I/O Blocking operation. If we represent the synchronous execution as a timeline:

Now if we execute the same operation in an asynchronous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required