In general, applications waste a lot of time waiting for things to happen. Maybe we are waiting for an expensive computation—say, calculating the 1,000th Fibonacci number. Perhaps we are waiting for some information to be written to the database. We could also be waiting for a network call to return, bringing us the latest recommendations from our favorite online store.
Regardless of what we're waiting for, we should never block clients of our application. This is crucial to achieving the responsiveness we desire when building reactive systems. And the first step toward reactive applications is to break out of synchronous processing.
In an age where processing cores are abundant—my MacBook Pro has eight processor cores—blocking APIs severely underutilizes the resources we have at our disposal.
After seeing a few examples of...