Skip to Main Content
Hands-On Reactive Programming with Clojure - Second Edition
book

Hands-On Reactive Programming with Clojure - Second Edition

by Konrad Szydlo, Leonardo Borges
January 2019
Intermediate to advanced content levelIntermediate to advanced
298 pages
7h 46m
English
Packt Publishing
Content preview from Hands-On Reactive Programming with Clojure - Second Edition

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 #(= ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Clojure Programming

Clojure Programming

Chas Emerick, Brian Carper, Christophe Grand
Clojure in Action, Second Edition

Clojure in Action, Second Edition

Amit Rathore, Francis Avila
Programming Clojure, 2nd Edition

Programming Clojure, 2nd Edition

Stuart Halloway, Aaron Bedra

Publisher Resources

ISBN: 9781789346138Supplemental Content