Utilizing Asynchronous Programming for Scalability
Whenever we execute a function, we expect a result, but what happens between the request and the outputted result?
Imagine you’re in town, and you have a bunch of errands to run, but you’re also hungry and need to eat lunch. You walk into a pizza shop, situated within a shopping mall. The shop cooks fresh pizza to order. It takes around fifteen minutes for the pizza to be prepped and then cooked. You can wait around in the shop until the pizza is done, but you need to go to the bank, which has a branch across the road. The pizza store owner is a friend of yours and agrees to text you when your pizza is ready to pick up. You have an opportunity to get something else done while your pizza is cooking; that’s a much better use of your time.
This is a simple analogy for an asynchronous function. The act of walking into the pizza shop is the function starting, and you running over to the bank while it is cooking...