File tree Expand file tree Collapse file tree 3 files changed +31
-5
lines changed
Expand file tree Collapse file tree 3 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 11(ns expt1.core
2- (:require [expt1.k2 :as k2])
2+ (:require [expt1.k2 :as k2]
3+ ; [expt1.k1 :as k1]
4+ )
35 (:import [rx Observable Observer Subscription]
46 [rx.util AtomicObservableSubscription])
57 (:gen-class )
68 )
79
10+
11+
812(defn -main
913 " I don't do a whole lot ... yet."
1014 [& args]
2024 (Observable/filter (fn [x] (= 0 (mod x 2 ))))
2125 (.subscribe println))
2226
27+ (.subscribe (k2/customObservableBlocking ) println)
28+
29+ (.subscribe (k2/customObservableNonBlocking ) println)
30+
31+ (->
32+ (k2/fetchWikipediaArticleAsynchronously [" Tiger" " Elephant" ])
33+ (.subscribe #(println " --- Article ---\n " (subs (:body %) 0 125 ) " ..." ))
34+ )
35+
36+ (k2/simpleComposition )
37+
38+ (->
39+ (k2/getVideoForUser 12345 78965 )
40+ (.subscribe
41+ (fn [datum] (println " --- Object ---\n " datum))
42+ (fn [exception] (println " --- Error ---\n " exception))
43+ (fn [] (println " --- Completed ---\n " ))))
44+
45+ (->
46+ (k2/fetchWikipediaArticleAsynchronouslyWithErrorHandling [" Tiger" " NonExistentTitle" " Elephant" ])
47+ (.subscribe #(println " --- Article ---\n " (subs (:body %) 0 125 ) " ..." )
48+ #(println " --- Error ---\n " (.getMessage %))
49+ ))
2350 )
Original file line number Diff line number Diff line change 1- (ns expt1.k1.core ; ;rx-clj.core
1+ (ns expt1.k1 ; ;rx-clj.core
22 (:refer-clojure :exclude [concat cons drop drop-while empty
33 filter first future
44 interpose into keep keep-indexed last
8383 (.unsubscribe s)
8484 s )
8585
86+ ; ;; bbeckman this would not load
87+
8688(defn ^Subscription subscription
8789 " Create a new subscription that calls the given no-arg handler function"
8890 [handler]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments