Introduction At Binary, we have an increasing amount of code that uses Futures to represent asynchronous operations. The power of these objects comes with the increased complexity of writing readable code that makes use of them. Various articles I have previously written have described Futures and their use. In this
Caching the results of Future-returning functions Often when making read requests or queries to some external service, it is helpful to cache the results of these queries so that other requests for the same information can use that directly, rather than having to repeat the query to that same service.
Limiting Concurrency in Future-based Programming Sometimes a Future-based program needs to actively avoid concurrency in one specific way or area, and ensure that only one instance of a given operation is outstanding at any one time. While the program as a whole can make use of concurrency to do multiple