![Page 1: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/1.jpg)
Joseph Wilk
![Page 2: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/2.jpg)
The Clojure Inside
![Page 3: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/3.jpg)
![Page 4: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/4.jpg)
Why Clojure?
![Page 5: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/5.jpg)
LISP Concurrency
ImmutableFunctional
Simple
It was there!
![Page 6: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/6.jpg)
LISP Concurrency
ImmutableFunctional
Simple
It was there!
![Page 7: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/7.jpg)
Programming Language
Computer
![Page 8: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/8.jpg)
LISP Hurts (Pick languages that challenge your mental model)
(( ))
![Page 9: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/9.jpg)
(defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects." {:added "1.0" :static true} ([pred coll] (lazy-seq (when-let [s (seq coll)] (if (chunked-seq? s) (let [c (chunk-first s) size (count c) b (chunk-buffer size)] (dotimes [i size] (when (pred (.nth c i)) (chunk-append b (.nth c i)))) (chunk-cons (chunk b) (filter pred (chunk-rest s)))) (let [f (first s) r (rest s)] (if (pred f) (cons f (filter pred r)) (filter pred r))))))))
![Page 10: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/10.jpg)
(defmacro doseq
"Repeatedly executes body (presumably for side-effects) with
bindings and filtering as provided by \"for\". Does not retain
the head of the sequence. Returns nil."
{:added "1.0"}
[seq-exprs & body]
(assert-args
(vector? seq-exprs) "a vector for its binding"
(even? (count seq-exprs)) "an even number of forms in binding vector")
(let [step (fn step [recform exprs]
(if-not exprs
[true `(do ~@body)]
(let [k (first exprs)
v (second exprs)]
(if (keyword? k)
(let [steppair (step recform (nnext exprs))
needrec (steppair 0)
subform (steppair 1)]
(cond
(= k :let) [needrec `(let ~v ~subform)]
(= k :while) [false `(when ~v
~subform
~@(when needrec [recform]))]
(= k :when) [false `(if ~v
(do
~subform
~@(when needrec [recform]))
~recform)]))
(let [seq- (gensym "seq_")
chunk- (with-meta (gensym "chunk_")
{:tag 'clojure.lang.IChunk})
count- (gensym "count_")
i- (gensym "i_")
recform `(recur (next ~seq-) nil 0 0)
steppair (step recform (nnext exprs))
needrec (steppair 0)
subform (steppair 1)
recform-chunk
`(recur ~seq- ~chunk- ~count- (unchecked-inc ~i-))
wee wee
wee wee
wee wee
wee wee
wee
Code generation
Code is dataData is code
Functions what do functions
Variable generation
Is that a class?
![Page 11: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/11.jpg)
OH MYITS
FAST(Jetty/Netty but sssssh)
(Shhh confirmation Bias)
![Page 12: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/12.jpg)
History
![Page 13: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/13.jpg)
Rails
Me
![Page 14: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/14.jpg)
Rails
Me
![Page 15: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/15.jpg)
Ruby
![Page 16: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/16.jpg)
Small
Replaceable
Pieces
![Page 17: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/17.jpg)
Experiment
A B?
Opening(Divergent)
Exploring(Emergent)
Closing(Convergent)
![Page 18: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/18.jpg)
Clojure
![Page 19: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/19.jpg)
HystrixTurbineRxJavaNettyAlephCompojure
https://github.com/Netflix/Hystrix
https://github.com/Netflix/Turbine
https://github.com/Netflix/RxJava
https://github.com/ztellman/aleph
https://github.com/weavejester/compojure
http://netty.io
Midje https://github.com/marick/Midje
Ring https://github.com/ring-clojure/ring
![Page 20: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/20.jpg)
MaturityBrevity
+ & Denial (its not Java)
![Page 21: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/21.jpg)
atom
quote
eq
car
cdr
cons
cond
lambda
label
apply
![Page 22: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/22.jpg)
JavaDenial
(defmacro)
![Page 23: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/23.jpg)
HttpServer server = HttpServer.create(address, 0)server.createContext(path, handler);server.setExecutor(null)server.start();
(doto (HttpServer/create address 0) (.createContext path handler) (.setExecutor nil) (.start))
![Page 24: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/24.jpg)
HttpServer server = HttpServer.create(address, 0)server.createContext(path, handler);server.setExecutor(null)server.start();
(doto (HttpServer/create address 0) (.createContext path handler) (.setExecutor nil) (.start))
![Page 25: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/25.jpg)
public class GetSoundCmd extends HystrixCommand<Sound> { private final HttpClient client; private final String urn; public FindSoundCmd(HttpClient client, String urn){ this.client = client; this.urn = urn; } @Override protected Sound run(){ return client.get("/sounds/" + urn, Sound.class) }
@Override protected Sound getFallback(){ return Sound.missing(id); }}new GetUserCmd(client, id).execute();
(:require [com.netflix.hystrix.core :as hystrix])
(hystrix/defcommand find-sound {:hystrix/fallback-fn #(constantly {}))} [client urn] (http/get urn)) (get-sound client "soundcloud:sounds:123")
![Page 26: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/26.jpg)
public class GetSoundCmd extends HystrixCommand<Sound> { private final HttpClient client; private final String urn; public FindSoundCmd(HttpClient client, String urn){ this.client = client; this.urn = urn; } @Override protected Sound run(){ return client.get("/sounds/" + urn, Sound.class) }
@Override protected Sound getFallback(){ return Sound.missing(id); }}new GetUserCmd(client, id).execute();
(:require [com.netflix.hystrix.core :as hystrix])
(hystrix/defcommand find-sound {:hystrix/fallback-fn #(constantly {}))} [client urn] (http/get urn)) (get-sound client "soundcloud:sounds:123")
![Page 27: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/27.jpg)
InteractivityR readE evaluateP printL loop
![Page 28: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/28.jpg)
![Page 29: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/29.jpg)
Services at scale
![Page 30: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/30.jpg)
![Page 31: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/31.jpg)
Grace in the face of failurehigh partition tolerance in a high latency cloud network
(don't trust anything works)
![Page 32: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/32.jpg)
Threadpool(future (fn [] "from the future"))
(promise)
(agent)
![Page 33: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/33.jpg)
![Page 34: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/34.jpg)
![Page 35: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/35.jpg)
![Page 36: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/36.jpg)
![Page 37: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/37.jpg)
Threadpool
100 threads
Bulkhead
Threadpool
10 threads
Threadpool
10 threads
Threadpool
30 threads
Scheduler
queue
![Page 38: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/38.jpg)
(hystrix/defcommand find-user {:hystrix/fallback-fn (constantly {})} [user-urn] (let [response (get-user user-urn)] (if (= 200 (:status response)) (:body response) {})))
(find-user 123)
(hystrix/queue #‘find-user 123)
(defn find-user [user-urn] (let [response (get-user user-urn)] (if (= 200 (:status response)) (:body response) {})))
![Page 39: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/39.jpg)
(hystrix/defcommand find-user {:hystrix/fallback-fn (constantly {})} [user-urn] (let [response (get-user user-urn)] (if (= 200 (:status response)) (:body response) {})))
(find-user 123)
(hystrix/queue #‘find-user 123)
(defn find-user [user-urn] (let [response (get-user user-urn)] (if (= 200 (:status response)) (:body response) {})))
![Page 40: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/40.jpg)
(hystrix/defcommand find-user {:hystrix/fallback-fn (constantly {})} [user-urn] (let [response (get-user user-urn)] (if (= 200 (:status response)) (:body response) {})))
(find-user 123)
(hystrix/queue #‘find-user 123)
(defn find-user [user-urn] (let [response (get-user user-urn)] (if (= 200 (:status response)) (:body response) {})))
![Page 41: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/41.jpg)
Consumers Service X Turbine
DNS
Dashboard
Service X
Service X
Service X
Service X
metrics
discovery
![Page 42: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/42.jpg)
https://github.com/Netflix/Hystrix
![Page 43: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/43.jpg)
![Page 44: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/44.jpg)
Compositional Complexity
![Page 45: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/45.jpg)
a cb
d
gfe
![Page 46: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/46.jpg)
a cb
d
gfe
![Page 47: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/47.jpg)
a
c
b
d gzipmap
List Processing
zip e
![Page 48: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/48.jpg)
List Processing
a
c
b
d gzipmap
zip e
![Page 49: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/49.jpg)
LisP
a
c
b
d gzipmap
zip e
![Page 50: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/50.jpg)
RxJava
(map)(zip)(filter)(partition)(reduce)
https://github.com/Netflix/RxJava
![Page 51: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/51.jpg)
a
c
b
d gzipmap
zip e
on-erroron-complete
Ending Callback Hell
(.subscribe (fn [result] (enqueue channel {:status 200 :body (json/encode result}) (fn [error] (log/exception error request))))))
![Page 52: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/52.jpg)
https://github.com/ztellman/aleph
Request & Response
(.subscribe (fn [result] (enqueue channel {:status 200 :body (json/encode result}) (fn [error] (log/exception error request))))))
(defn handler [request] {:status 200 :body "Hello World"})
(use 'lamina.core)
(defn handler [response-channel request] (enqueue response-channel {:status 200 :body "Hello World"}))
![Page 53: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/53.jpg)
https://github.com/ztellman/aleph
Request & Response
(.subscribe (fn [result] (enqueue channel {:status 200 :body (json/encode result}) (fn [error] (log/exception error request))))))
(defn handler [request] {:status 200 :body "Hello World"})
(use 'lamina.core)
(defn handler [response-channel request] (enqueue response-channel {:status 200 :body "Hello World"}))
![Page 54: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/54.jpg)
https://github.com/ztellman/aleph
Request & Response
(.subscribe (fn [result] (enqueue channel {:status 200 :body (json/encode result}) (fn [error] (log/exception error request))))))
(defn handler [request] {:status 200 :body "Hello World"})
(use 'lamina.core)
(defn handler [response-channel request] (enqueue response-channel {:status 200 :body "Hello World"}))
![Page 55: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/55.jpg)
https://github.com/ztellman/aleph
Request & Response
(.subscribe (fn [result] (enqueue channel {:status 200 :body (json/encode result}) (fn [error] (log/exception error request))))))
(defn handler [request] {:status 200 :body "Hello World"})
(use 'lamina.core)
(defn handler [response-channel request] (enqueue response-channel {:status 200 :body "Hello World"}))
![Page 56: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/56.jpg)
Clojure Itches
Its upside down attern matching
Corrupts your brainparameter redeye
![Page 57: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/57.jpg)
Clojure
One of the many paths
![Page 58: Joseph Wilk - GOTO Conferencegotocon.com/dl/goto-berlin-2013/slides/JosephWilk... · (defn filter "Returns a lazy sequence of the items in coll for which (pred item) returns true](https://reader030.vdocuments.mx/reader030/viewer/2022040806/5e467c2f5f8fcb3621428a53/html5/thumbnails/58.jpg)
Joseph Wilk