Programming Asynchronously

We'll cover the following

sWhen programming modern applications we often have to make calls to remote services, update databases, perform searches, and the list goes on. Many of these tasks aren’t instantaneous. To improve program efficiency we may want to execute such operations asynchronously, in a non-blocking manner. Coroutines are intended to exactly solve that problem.

Starting sequentially

Let’s create a program to go out and get the weather details to see if there are any delays at certain airports. As a first step, we’ll create an Airport class that will hold the data, along with a Weather class to hold the temperature. We’ll use the Klaxon library to parse the JSON response from the Federal Aviation Administration (FAA) airport status web service.

Get hands-on with 1200+ tech skills courses.