The movies example revisited

Still within our imminent-playground project, open the src/imminent_playground/core.clj file and add the appropriate definitions:

(ns imminent-playground.core 
  (:require [clojure.pprint :refer [pprint]] 
            [imminent.core :as i])) 
 
(def movie ...) 
 
(def actor-movies ...) 
 
(def actor-spouse ...) 
 
(def top-5-movies ...) 

We will be using the same data as in the previous program, which is represented in the preceding snippet by the use of ellipses. Simply copy the relevant declarations over.

The service functions will need small tweaks in this new version:

(defn cast-by-movie [name] (i/future (do (Thread/sleep 5000) (:cast movie)))) (defn movies-by-actor [name] (i/future (do (Thread/sleep 2000) (->> actor-movies (filter #(= ...

Get Hands-On Reactive Programming with Clojure - Second Edition 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.