Chapter 28

Case Study: Parallel Strategies

Our final case study expands on the previous one by focusing on the parallel execution of functions—as opposed to the actions examined in Chapter 24. It considers a scenario in which several functions are applied to the same input, each with a different likelihood of succeeding. The implementation leverages the concurrency constructs explored in earlier chapters—promises, futures, higher-order functions—and uses their features to address failure, timeout, cancellation, and caching issues.

28.1 Problem Definition

Note

This case study was inspired by a problem I faced, a long time ago, while working on static analysis of programs. I was implementing a tool that worked by generating proof obligations—that ...

Get Functional and Concurrent Programming: Core Concepts and Features now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.