
6/19/2015 · Hans Fugal
What this post added
This post introduces Folly Futures, a C++11 implementation of futures used at Facebook. It explains the benefits of asynchronous programming over synchronous programming for services, detailing how futures simplify the composition of asynchronous computations, both sequentially and in parallel. The post highlights the `then` and `collect` methods, discusses explicit control over execution contexts using an `Executor` interface, and explains how futures improve error handling compared to traditional callback-based approaches. It also covers how to create futures using `makeFuture` and `Promise`, and provides a case study of Instagram improving its recommendation service latency and robustness by adopting futures.