August 2018
Intermediate to advanced
380 pages
10h 2m
English
Imagine your program performs an HTTP call. For example, it tries to retrieve some JSON object from a web API. It can take some time; it may even take several seconds to complete.
Imagine that you want to make some competition within a function and return some value based on the result of the API request. You run into a problem here because the result of the API call was not available immediately. The fact that you need to wait for a specific long-running operation to complete is also a side effect.
You can block on this long-running operation and resume your competition once the result arrives. However, this function will also block any functions that are calling it. In the context of a performance-critical ...