Introduction to Scala AP
Before starting with Scala AP, it is good to understand what asynchronous means and its benefits.
In this section, we will discuss what asynchronous is and how it differs from synchronous. We will also discuss how Scala supports asynchronous programming.
What is asynchronous?
We will define it in simple words in terms of computer programs. Let's assume we have two functions or methods or operations—function a()
and function b()
. Function b()
uses function a()
to fulfill its job.
The function a()
is said to be asynchronous if function b()
makes a call to function a()
and does not wait for function a()
response. Function b()
continues doing it's next available tasks without waiting or blocking. Function b()
utilizes function a()
result once function a()
finishes its computation and send response back to function b()
. Here function a()
is known as called function and function b()
is known as calling function.
So, the calling function just make a call to called function,...