To understand the issues outlined in the previous section better, let's build a more complex example that fetches data about one of my favorite movies, The Lord of the Rings.
The idea is that, given the movie, we wish to retrieve its actors and, for each actor, retrieve the movies they have been a part of. We would also like to find out more information about each actor, such as their spouses.
Additionally, we will match each actor's movies against the list of top five movies to highlight them as such. Finally, the result will be printed to the screen.
From the problem statement, we can identify the following two main characteristics we will need to account for:
- Some of these tasks need to be performed in parallel
- They establish dependencies on each other
To get started, let's create a new Leiningen project:
lein new clj-futures-playground...