added github pages support

This commit is contained in:
didier amyot committed 2018-01-27 11:27:33 -05:00
1 parent b14ebdbf63
commit 6ed638a1cc
373 files changed
+185436 -2343

No files matched your search

+929
View File
@@ -0,0 +1,929 @@
(ns cljs.core.async
(:refer-clojure :exclude [reduce transduce into merge map take partition partition-by])
(:require [cljs.core.async.impl.protocols :as impl]
[cljs.core.async.impl.channels :as channels]
[cljs.core.async.impl.buffers :as buffers]
[cljs.core.async.impl.timers :as timers]
[cljs.core.async.impl.dispatch :as dispatch]
[cljs.core.async.impl.ioc-helpers :as helpers])
(:require-macros [cljs.core.async.impl.ioc-macros :as ioc]
[cljs.core.async.macros :refer [go go-loop]]))
(defn- fn-handler
([f] (fn-handler f true))
([f blockable]
(reify
impl/Handler
(active? [_] true)
(blockable? [_] blockable)
(commit [_] f))))
(defn buffer
"Returns a fixed buffer of size n. When full, puts will block/park."
[n]
(buffers/fixed-buffer n))
(defn dropping-buffer
"Returns a buffer of size n. When full, puts will complete but
val will be dropped (no transfer)."
[n]
(buffers/dropping-buffer n))
(defn sliding-buffer
"Returns a buffer of size n. When full, puts will complete, and be
buffered, but oldest elements in buffer will be dropped (not
transferred)."
[n]
(buffers/sliding-buffer n))
(defn unblocking-buffer?
"Returns true if a channel created with buff will never block. That is to say,
puts into this buffer will never cause the buffer to be full. "
[buff]
(satisfies? impl/UnblockingBuffer buff))
(defn chan
"Creates a channel with an optional buffer, an optional transducer (like (map f),
(filter p) etc or a composition thereof), and an optional exception handler.
If buf-or-n is a number, will create and use a fixed buffer of that size. If a
transducer is supplied a buffer must be specified. ex-handler must be a
fn of one argument - if an exception occurs during transformation it will be called
with the thrown value as an argument, and any non-nil return value will be placed
in the channel."
([] (chan nil))
([buf-or-n] (chan buf-or-n nil nil))
([buf-or-n xform] (chan buf-or-n xform nil))
([buf-or-n xform ex-handler]
(let [buf-or-n (if (= buf-or-n 0)
nil
buf-or-n)]
(when xform (assert buf-or-n "buffer must be supplied when transducer is"))
(channels/chan (if (number? buf-or-n)
(buffer buf-or-n)
buf-or-n)
xform
ex-handler))))
(defn promise-chan
"Creates a promise channel with an optional transducer, and an optional
exception-handler. A promise channel can take exactly one value that consumers
will receive. Once full, puts complete but val is dropped (no transfer).
Consumers will block until either a value is placed in the channel or the
channel is closed. See chan for the semantics of xform and ex-handler."
([] (promise-chan nil))
([xform] (promise-chan xform nil))
([xform ex-handler]
(chan (buffers/promise-buffer) xform ex-handler)))
(defn timeout
"Returns a channel that will close after msecs"
[msecs]
(timers/timeout msecs))
(defn <!
"takes a val from port. Must be called inside a (go ...) block. Will
return nil if closed. Will park if nothing is available.
Returns true unless port is already closed"
[port]
(throw (js/Error. "<! used not in (go ...) block")))
(defn take!
"Asynchronously takes a val from port, passing to fn1. Will pass nil
if closed. If on-caller? (default true) is true, and value is
immediately available, will call fn1 on calling thread.
Returns nil."
([port fn1] (take! port fn1 true))
([port fn1 on-caller?]
(let [ret (impl/take! port (fn-handler fn1))]
(when ret
(let [val @ret]
(if on-caller?
(fn1 val)
(dispatch/run #(fn1 val)))))
nil)))
(defn- nop [_])
(def ^:private fhnop (fn-handler nop))
(defn >!
"puts a val into port. nil values are not allowed. Must be called
inside a (go ...) block. Will park if no buffer space is available.
Returns true unless port is already closed."
[port val]
(throw (js/Error. ">! used not in (go ...) block")))
(defn put!
"Asynchronously puts a val into port, calling fn0 (if supplied) when
complete. nil values are not allowed. Will throw if closed. If
on-caller? (default true) is true, and the put is immediately
accepted, will call fn0 on calling thread. Returns nil."
([port val]
(if-let [ret (impl/put! port val fhnop)]
@ret
true))
([port val fn1] (put! port val fn1 true))
([port val fn1 on-caller?]
(if-let [retb (impl/put! port val (fn-handler fn1))]
(let [ret @retb]
(if on-caller?
(fn1 ret)
(dispatch/run #(fn1 ret)))
ret)
true)))
(defn close!
([port]
(impl/close! port)))
(defn- random-array
[n]
(let [a (make-array n)]
(dotimes [x n]
(aset a x 0))
(loop [i 1]
(if (= i n)
a
(do
(let [j (rand-int i)]
(aset a i (aget a j))
(aset a j i)
(recur (inc i))))))))
(defn- alt-flag []
(let [flag (atom true)]
(reify
impl/Handler
(active? [_] @flag)
(blockable? [_] true)
(commit [_]
(reset! flag nil)
true))))
(defn- alt-handler [flag cb]
(reify
impl/Handler
(active? [_] (impl/active? flag))
(blockable? [_] true)
(commit [_]
(impl/commit flag)
cb)))
(defn do-alts
"returns derefable [val port] if immediate, nil if enqueued"
[fret ports opts]
(let [flag (alt-flag)
n (count ports)
idxs (random-array n)
priority (:priority opts)
ret
(loop [i 0]
(when (< i n)
(let [idx (if priority i (aget idxs i))
port (nth ports idx)
wport (when (vector? port) (port 0))
vbox (if wport
(let [val (port 1)]
(impl/put! wport val (alt-handler flag #(fret [% wport]))))
(impl/take! port (alt-handler flag #(fret [% port]))))]
(if vbox
(channels/box [@vbox (or wport port)])
(recur (inc i))))))]
(or
ret
(when (contains? opts :default)
(when-let [got (and (impl/active? flag) (impl/commit flag))]
(channels/box [(:default opts) :default]))))))
(defn alts!
"Completes at most one of several channel operations. Must be called
inside a (go ...) block. ports is a vector of channel endpoints,
which can be either a channel to take from or a vector of
[channel-to-put-to val-to-put], in any combination. Takes will be
made as if by <!, and puts will be made as if by >!. Unless
the :priority option is true, if more than one port operation is
ready a non-deterministic choice will be made. If no operation is
ready and a :default value is supplied, [default-val :default] will
be returned, otherwise alts! will park until the first operation to
become ready completes. Returns [val port] of the completed
operation, where val is the value taken for takes, and a
boolean (true unless already closed, as per put!) for puts.
opts are passed as :key val ... Supported options:
:default val - the value to use if none of the operations are immediately ready
:priority true - (default nil) when true, the operations will be tried in order.
Note: there is no guarantee that the port exps or val exprs will be
used, nor in what order should they be, so they should not be
depended upon for side effects."
[ports & {:as opts}]
(throw (js/Error. "alts! used not in (go ...) block")))
(defn offer!
"Puts a val into port if it's possible to do so immediately.
nil values are not allowed. Never blocks. Returns true if offer succeeds."
[port val]
(let [ret (impl/put! port val (fn-handler nop false))]
(when ret @ret)))
(defn poll!
"Takes a val from port if it's possible to do so immediately.
Never blocks. Returns value if successful, nil otherwise."
[port]
(let [ret (impl/take! port (fn-handler nop false))]
(when ret @ret)))
;;;;;;; channel ops
(defn pipe
"Takes elements from the from channel and supplies them to the to
channel. By default, the to channel will be closed when the from
channel closes, but can be determined by the close? parameter. Will
stop consuming the from channel if the to channel closes"
([from to] (pipe from to true))
([from to close?]
(go-loop []
(let [v (<! from)]
(if (nil? v)
(when close? (close! to))
(when (>! to v)
(recur)))))
to))
(defn- pipeline*
([n to xf from close? ex-handler type]
(assert (pos? n))
(let [jobs (chan n)
results (chan n)
process (fn [[v p :as job]]
(if (nil? job)
(do (close! results) nil)
(let [res (chan 1 xf ex-handler)]
(go
(>! res v)
(close! res))
(put! p res)
true)))
async (fn [[v p :as job]]
(if (nil? job)
(do (close! results) nil)
(let [res (chan 1)]
(xf v res)
(put! p res)
true)))]
(dotimes [_ n]
(case type
:compute (go-loop []
(let [job (<! jobs)]
(when (process job)
(recur))))
:async (go-loop []
(let [job (<! jobs)]
(when (async job)
(recur))))))
(go-loop []
(let [v (<! from)]
(if (nil? v)
(close! jobs)
(let [p (chan 1)]
(>! jobs [v p])
(>! results p)
(recur)))))
(go-loop []
(let [p (<! results)]
(if (nil? p)
(when close? (close! to))
(let [res (<! p)]
(loop []
(let [v (<! res)]
(when (and (not (nil? v)) (>! to v))
(recur))))
(recur))))))))
(defn pipeline-async
"Takes elements from the from channel and supplies them to the to
channel, subject to the async function af, with parallelism n. af
must be a function of two arguments, the first an input value and
the second a channel on which to place the result(s). af must close!
the channel before returning. The presumption is that af will
return immediately, having launched some asynchronous operation
whose completion/callback will manipulate the result channel. Outputs
will be returned in order relative to the inputs. By default, the to
channel will be closed when the from channel closes, but can be
determined by the close? parameter. Will stop consuming the from
channel if the to channel closes."
([n to af from] (pipeline-async n to af from true))
([n to af from close?] (pipeline* n to af from close? nil :async)))
(defn pipeline
"Takes elements from the from channel and supplies them to the to
channel, subject to the transducer xf, with parallelism n. Because
it is parallel, the transducer will be applied independently to each
element, not across elements, and may produce zero or more outputs
per input. Outputs will be returned in order relative to the
inputs. By default, the to channel will be closed when the from
channel closes, but can be determined by the close? parameter. Will
stop consuming the from channel if the to channel closes.
Note this is supplied for API compatibility with the Clojure version.
Values of N > 1 will not result in actual concurrency in a
single-threaded runtime."
([n to xf from] (pipeline n to xf from true))
([n to xf from close?] (pipeline n to xf from close? nil))
([n to xf from close? ex-handler] (pipeline* n to xf from close? ex-handler :compute)))
(defn split
"Takes a predicate and a source channel and returns a vector of two
channels, the first of which will contain the values for which the
predicate returned true, the second those for which it returned
false.
The out channels will be unbuffered by default, or two buf-or-ns can
be supplied. The channels will close after the source channel has
closed."
([p ch] (split p ch nil nil))
([p ch t-buf-or-n f-buf-or-n]
(let [tc (chan t-buf-or-n)
fc (chan f-buf-or-n)]
(go-loop []
(let [v (<! ch)]
(if (nil? v)
(do (close! tc) (close! fc))
(when (>! (if (p v) tc fc) v)
(recur)))))
[tc fc])))
(defn reduce
"f should be a function of 2 arguments. Returns a channel containing
the single result of applying f to init and the first item from the
channel, then applying f to that result and the 2nd item, etc. If
the channel closes without yielding items, returns init and f is not
called. ch must close before reduce produces a result."
[f init ch]
(go-loop [ret init]
(let [v (<! ch)]
(if (nil? v)
ret
(let [ret' (f ret v)]
(if (reduced? ret')
@ret'
(recur ret')))))))
(defn transduce
"async/reduces a channel with a transformation (xform f).
Returns a channel containing the result. ch must close before
transduce produces a result."
[xform f init ch]
(let [f (xform f)]
(go
(let [ret (<! (reduce f init ch))]
(f ret)))))
(defn onto-chan
"Puts the contents of coll into the supplied channel.
By default the channel will be closed after the items are copied,
but can be determined by the close? parameter.
Returns a channel which will close after the items are copied."
([ch coll] (onto-chan ch coll true))
([ch coll close?]
(go-loop [vs (seq coll)]
(if (and vs (>! ch (first vs)))
(recur (next vs))
(when close?
(close! ch))))))
(defn to-chan
"Creates and returns a channel which contains the contents of coll,
closing when exhausted."
[coll]
(let [ch (chan (bounded-count 100 coll))]
(onto-chan ch coll)
ch))
(defprotocol Mux
(muxch* [_]))
(defprotocol Mult
(tap* [m ch close?])
(untap* [m ch])
(untap-all* [m]))
(defn mult
"Creates and returns a mult(iple) of the supplied channel. Channels
containing copies of the channel can be created with 'tap', and
detached with 'untap'.
Each item is distributed to all taps in parallel and synchronously,
i.e. each tap must accept before the next item is distributed. Use
buffering/windowing to prevent slow taps from holding up the mult.
Items received when there are no taps get dropped.
If a tap puts to a closed channel, it will be removed from the mult."
[ch]
(let [cs (atom {}) ;;ch->close?
m (reify
Mux
(muxch* [_] ch)
Mult
(tap* [_ ch close?] (swap! cs assoc ch close?) nil)
(untap* [_ ch] (swap! cs dissoc ch) nil)
(untap-all* [_] (reset! cs {}) nil))
dchan (chan 1)
dctr (atom nil)
done (fn [_] (when (zero? (swap! dctr dec))
(put! dchan true)))]
(go-loop []
(let [val (<! ch)]
(if (nil? val)
(doseq [[c close?] @cs]
(when close? (close! c)))
(let [chs (keys @cs)]
(reset! dctr (count chs))
(doseq [c chs]
(when-not (put! c val done)
(done nil)
(untap* m c)))
;;wait for all
(when (seq chs)
(<! dchan))
(recur)))))
m))
(defn tap
"Copies the mult source onto the supplied channel.
By default the channel will be closed when the source closes,
but can be determined by the close? parameter."
([mult ch] (tap mult ch true))
([mult ch close?] (tap* mult ch close?) ch))
(defn untap
"Disconnects a target channel from a mult"
[mult ch]
(untap* mult ch))
(defn untap-all
"Disconnects all target channels from a mult"
[mult] (untap-all* mult))
(defprotocol Mix
(admix* [m ch])
(unmix* [m ch])
(unmix-all* [m])
(toggle* [m state-map])
(solo-mode* [m mode]))
(defn ioc-alts! [state cont-block ports & {:as opts}]
(ioc/aset-all! state helpers/STATE-IDX cont-block)
(when-let [cb (cljs.core.async/do-alts
(fn [val]
(ioc/aset-all! state helpers/VALUE-IDX val)
(helpers/run-state-machine-wrapped state))
ports
opts)]
(ioc/aset-all! state helpers/VALUE-IDX @cb)
:recur))
(defn mix
"Creates and returns a mix of one or more input channels which will
be put on the supplied out channel. Input sources can be added to
the mix with 'admix', and removed with 'unmix'. A mix supports
soloing, muting and pausing multiple inputs atomically using
'toggle', and can solo using either muting or pausing as determined
by 'solo-mode'.
Each channel can have zero or more boolean modes set via 'toggle':
:solo - when true, only this (ond other soloed) channel(s) will appear
in the mix output channel. :mute and :pause states of soloed
channels are ignored. If solo-mode is :mute, non-soloed
channels are muted, if :pause, non-soloed channels are
paused.
:mute - muted channels will have their contents consumed but not included in the mix
:pause - paused channels will not have their contents consumed (and thus also not included in the mix)
"
[out]
(let [cs (atom {}) ;;ch->attrs-map
solo-modes #{:mute :pause}
attrs (conj solo-modes :solo)
solo-mode (atom :mute)
change (chan)
changed #(put! change true)
pick (fn [attr chs]
(reduce-kv
(fn [ret c v]
(if (attr v)
(conj ret c)
ret))
#{} chs))
calc-state (fn []
(let [chs @cs
mode @solo-mode
solos (pick :solo chs)
pauses (pick :pause chs)]
{:solos solos
:mutes (pick :mute chs)
:reads (conj
(if (and (= mode :pause) (not (empty? solos)))
(vec solos)
(vec (remove pauses (keys chs))))
change)}))
m (reify
Mux
(muxch* [_] out)
Mix
(admix* [_ ch] (swap! cs assoc ch {}) (changed))
(unmix* [_ ch] (swap! cs dissoc ch) (changed))
(unmix-all* [_] (reset! cs {}) (changed))
(toggle* [_ state-map] (swap! cs (partial merge-with cljs.core/merge) state-map) (changed))
(solo-mode* [_ mode]
(assert (solo-modes mode) (str "mode must be one of: " solo-modes))
(reset! solo-mode mode)
(changed)))]
(go-loop [{:keys [solos mutes reads] :as state} (calc-state)]
(let [[v c] (alts! reads)]
(if (or (nil? v) (= c change))
(do (when (nil? v)
(swap! cs dissoc c))
(recur (calc-state)))
(if (or (solos c)
(and (empty? solos) (not (mutes c))))
(when (>! out v)
(recur state))
(recur state)))))
m))
(defn admix
"Adds ch as an input to the mix"
[mix ch]
(admix* mix ch))
(defn unmix
"Removes ch as an input to the mix"
[mix ch]
(unmix* mix ch))
(defn unmix-all
"removes all inputs from the mix"
[mix]
(unmix-all* mix))
(defn toggle
"Atomically sets the state(s) of one or more channels in a mix. The
state map is a map of channels -> channel-state-map. A
channel-state-map is a map of attrs -> boolean, where attr is one or
more of :mute, :pause or :solo. Any states supplied are merged with
the current state.
Note that channels can be added to a mix via toggle, which can be
used to add channels in a particular (e.g. paused) state."
[mix state-map]
(toggle* mix state-map))
(defn solo-mode
"Sets the solo mode of the mix. mode must be one of :mute or :pause"
[mix mode]
(solo-mode* mix mode))
(defprotocol Pub
(sub* [p v ch close?])
(unsub* [p v ch])
(unsub-all* [p] [p v]))
(defn pub
"Creates and returns a pub(lication) of the supplied channel,
partitioned into topics by the topic-fn. topic-fn will be applied to
each value on the channel and the result will determine the 'topic'
on which that value will be put. Channels can be subscribed to
receive copies of topics using 'sub', and unsubscribed using
'unsub'. Each topic will be handled by an internal mult on a
dedicated channel. By default these internal channels are
unbuffered, but a buf-fn can be supplied which, given a topic,
creates a buffer with desired properties.
Each item is distributed to all subs in parallel and synchronously,
i.e. each sub must accept before the next item is distributed. Use
buffering/windowing to prevent slow subs from holding up the pub.
Items received when there are no matching subs get dropped.
Note that if buf-fns are used then each topic is handled
asynchronously, i.e. if a channel is subscribed to more than one
topic it should not expect them to be interleaved identically with
the source."
([ch topic-fn] (pub ch topic-fn (constantly nil)))
([ch topic-fn buf-fn]
(let [mults (atom {}) ;;topic->mult
ensure-mult (fn [topic]
(or (get @mults topic)
(get (swap! mults
#(if (% topic) % (assoc % topic (mult (chan (buf-fn topic))))))
topic)))
p (reify
Mux
(muxch* [_] ch)
Pub
(sub* [p topic ch close?]
(let [m (ensure-mult topic)]
(tap m ch close?)))
(unsub* [p topic ch]
(when-let [m (get @mults topic)]
(untap m ch)))
(unsub-all* [_] (reset! mults {}))
(unsub-all* [_ topic] (swap! mults dissoc topic)))]
(go-loop []
(let [val (<! ch)]
(if (nil? val)
(doseq [m (vals @mults)]
(close! (muxch* m)))
(let [topic (topic-fn val)
m (get @mults topic)]
(when m
(when-not (>! (muxch* m) val)
(swap! mults dissoc topic)))
(recur)))))
p)))
(defn sub
"Subscribes a channel to a topic of a pub.
By default the channel will be closed when the source closes,
but can be determined by the close? parameter."
([p topic ch] (sub p topic ch true))
([p topic ch close?] (sub* p topic ch close?)))
(defn unsub
"Unsubscribes a channel from a topic of a pub"
[p topic ch]
(unsub* p topic ch))
(defn unsub-all
"Unsubscribes all channels from a pub, or a topic of a pub"
([p] (unsub-all* p))
([p topic] (unsub-all* p topic)))
;;;;
(defn map
"Takes a function and a collection of source channels, and returns a
channel which contains the values produced by applying f to the set
of first items taken from each source channel, followed by applying
f to the set of second items from each channel, until any one of the
channels is closed, at which point the output channel will be
closed. The returned channel will be unbuffered by default, or a
buf-or-n can be supplied"
([f chs] (map f chs nil))
([f chs buf-or-n]
(let [chs (vec chs)
out (chan buf-or-n)
cnt (count chs)
rets (object-array cnt)
dchan (chan 1)
dctr (atom nil)
done (mapv (fn [i]
(fn [ret]
(aset rets i ret)
(when (zero? (swap! dctr dec))
(put! dchan (.slice rets 0)))))
(range cnt))]
(go-loop []
(reset! dctr cnt)
(dotimes [i cnt]
(try
(take! (chs i) (done i))
(catch js/Object e
(swap! dctr dec))))
(let [rets (<! dchan)]
(if (some nil? rets)
(close! out)
(do (>! out (apply f rets))
(recur)))))
out)))
(defn merge
"Takes a collection of source channels and returns a channel which
contains all values taken from them. The returned channel will be
unbuffered by default, or a buf-or-n can be supplied. The channel
will close after all the source channels have closed."
([chs] (merge chs nil))
([chs buf-or-n]
(let [out (chan buf-or-n)]
(go-loop [cs (vec chs)]
(if (pos? (count cs))
(let [[v c] (alts! cs)]
(if (nil? v)
(recur (filterv #(not= c %) cs))
(do (>! out v)
(recur cs))))
(close! out)))
out)))
(defn into
"Returns a channel containing the single (collection) result of the
items taken from the channel conjoined to the supplied
collection. ch must close before into produces a result."
[coll ch]
(reduce conj coll ch))
(defn take
"Returns a channel that will return, at most, n items from ch. After n items
have been returned, or ch has been closed, the return chanel will close.
The output channel is unbuffered by default, unless buf-or-n is given."
([n ch]
(take n ch nil))
([n ch buf-or-n]
(let [out (chan buf-or-n)]
(go (loop [x 0]
(when (< x n)
(let [v (<! ch)]
(when (not (nil? v))
(>! out v)
(recur (inc x))))))
(close! out))
out)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; deprecated - do not use ;;;;;;;;;;;;;;;;;;;;;;;;;
(defn map<
"Deprecated - this function will be removed. Use transducer instead"
[f ch]
(reify
impl/Channel
(close! [_] (impl/close! ch))
(closed? [_] (impl/closed? ch))
impl/ReadPort
(take! [_ fn1]
(let [ret
(impl/take! ch
(reify
impl/Handler
(active? [_] (impl/active? fn1))
(blockable? [_] true)
#_(lock-id [_] (impl/lock-id fn1))
(commit [_]
(let [f1 (impl/commit fn1)]
#(f1 (if (nil? %) nil (f %)))))))]
(if (and ret (not (nil? @ret)))
(channels/box (f @ret))
ret)))
impl/WritePort
(put! [_ val fn1] (impl/put! ch val fn1))))
(defn map>
"Deprecated - this function will be removed. Use transducer instead"
[f ch]
(reify
impl/Channel
(close! [_] (impl/close! ch))
impl/ReadPort
(take! [_ fn1] (impl/take! ch fn1))
impl/WritePort
(put! [_ val fn1]
(impl/put! ch (f val) fn1))))
(defn filter>
"Deprecated - this function will be removed. Use transducer instead"
[p ch]
(reify
impl/Channel
(close! [_] (impl/close! ch))
(closed? [_] (impl/closed? ch))
impl/ReadPort
(take! [_ fn1] (impl/take! ch fn1))
impl/WritePort
(put! [_ val fn1]
(if (p val)
(impl/put! ch val fn1)
(channels/box (not (impl/closed? ch)))))))
(defn remove>
"Deprecated - this function will be removed. Use transducer instead"
[p ch]
(filter> (complement p) ch))
(defn filter<
"Deprecated - this function will be removed. Use transducer instead"
([p ch] (filter< p ch nil))
([p ch buf-or-n]
(let [out (chan buf-or-n)]
(go-loop []
(let [val (<! ch)]
(if (nil? val)
(close! out)
(do (when (p val)
(>! out val))
(recur)))))
out)))
(defn remove<
"Deprecated - this function will be removed. Use transducer instead"
([p ch] (remove< p ch nil))
([p ch buf-or-n] (filter< (complement p) ch buf-or-n)))
(defn- mapcat* [f in out]
(go-loop []
(let [val (<! in)]
(if (nil? val)
(close! out)
(do (doseq [v (f val)]
(>! out v))
(when-not (impl/closed? out)
(recur)))))))
(defn mapcat<
"Deprecated - this function will be removed. Use transducer instead"
([f in] (mapcat< f in nil))
([f in buf-or-n]
(let [out (chan buf-or-n)]
(mapcat* f in out)
out)))
(defn mapcat>
"Deprecated - this function will be removed. Use transducer instead"
([f out] (mapcat> f out nil))
([f out buf-or-n]
(let [in (chan buf-or-n)]
(mapcat* f in out)
in)))
(defn unique
"Deprecated - this function will be removed. Use transducer instead"
([ch]
(unique ch nil))
([ch buf-or-n]
(let [out (chan buf-or-n)]
(go (loop [last nil]
(let [v (<! ch)]
(when (not (nil? v))
(if (= v last)
(recur last)
(do (>! out v)
(recur v))))))
(close! out))
out)))
(defn partition
"Deprecated - this function will be removed. Use transducer instead"
([n ch]
(partition n ch nil))
([n ch buf-or-n]
(let [out (chan buf-or-n)]
(go (loop [arr (make-array n)
idx 0]
(let [v (<! ch)]
(if (not (nil? v))
(do (aset ^objects arr idx v)
(let [new-idx (inc idx)]
(if (< new-idx n)
(recur arr new-idx)
(do (>! out (vec arr))
(recur (make-array n) 0)))))
(do (when (> idx 0)
(>! out (vec arr)))
(close! out))))))
out)))
(defn partition-by
"Deprecated - this function will be removed. Use transducer instead"
([f ch]
(partition-by f ch nil))
([f ch buf-or-n]
(let [out (chan buf-or-n)]
(go (loop [lst (make-array 0)
last ::nothing]
(let [v (<! ch)]
(if (not (nil? v))
(let [new-itm (f v)]
(if (or (= new-itm last)
(keyword-identical? last ::nothing))
(do (.push lst v)
(recur lst new-itm))
(do (>! out (vec lst))
(let [new-lst (make-array 0)]
(.push new-lst v)
(recur new-lst new-itm)))))
(do (when (> (alength lst) 0)
(>! out (vec lst)))
(close! out))))))
out)))
@@ -0,0 +1 @@
{:rename-macros {}, :renames {}, :externs {Error {}, Array {}, Object {}}, :use-macros {go cljs.core.async.macros, go-loop cljs.core.async.macros}, :excludes #{reduce take map transduce into partition merge partition-by}, :name cljs.core.async, :imports nil, :requires {cljs.core.async.impl.channels cljs.core.async.impl.channels, cljs.core.async.impl.dispatch cljs.core.async.impl.dispatch, helpers cljs.core.async.impl.ioc-helpers, impl cljs.core.async.impl.protocols, channels cljs.core.async.impl.channels, cljs.core.async.impl.buffers cljs.core.async.impl.buffers, cljs.core.async.impl.protocols cljs.core.async.impl.protocols, timers cljs.core.async.impl.timers, dispatch cljs.core.async.impl.dispatch, cljs.core.async.impl.ioc-helpers cljs.core.async.impl.ioc-helpers, buffers cljs.core.async.impl.buffers, cljs.core.async.impl.timers cljs.core.async.impl.timers}, :cljs.spec/speced-vars [], :uses nil, :defs {Pub {:meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async.cljs", :line 599, :column 14, :end-line 599, :end-column 17, :doc nil, :protocol-symbol true, :jsdoc ("@interface"), :protocol-info {:methods {sub* [[p v ch close?]], unsub* [[p v ch]], unsub-all* [[p] [p v]]}}}, :protocol-symbol true, :name cljs.core.async/Pub, :file "target/cljsbuild/public/js/out/cljs/core/async.cljs", :end-column 17, :column 1, :line 599, :protocol-info {:methods {sub* [[p v ch close?]], unsub* [[p v ch]], unsub-all* [[p] [p v]]}}, :info nil, :end-line 599, :tag any, :impls #{cljs.core.async/t_cljs$core$async43363}, :doc nil, :jsdoc ("@interface")}, ->t_cljs$core$async43744 {:protocol-inline nil, :meta {:anonymous true, :protocols #{cljs.core.async.impl.protocols/Channel cljs.core.async.impl.protocols/WritePort cljs.core.async.impl.protocols/ReadPort cljs.core/IMeta cljs.core/IWithMeta}, :skip-protocol-flag #{cljs.core/IMeta cljs.core/IWithMeta}, :factory :positional, :arglists (quote ([p ch meta43745])), :file nil}, :protocols #{cljs.core.async.impl.protocols/Channel cljs.core.async.impl.protocols/WritePort cljs.core.async.impl.protocols/ReadPort cljs.core/IMeta cljs.core/IWithMeta}, :name cljs.core.async/->t_cljs$core$async43744, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async.cljs", :method-params ([p ch meta43745]), :protocol-impl nil, :arglists-meta (nil nil), :anonymous true, :column 3, :factory :positional, :line 805, :max-fixed-arity 3, :fn-var true, :arglists (quote ([p ch meta43745])), :skip-protocol-flag #{cljs.core/IMeta cljs.core/IWithMeta}}, reduce {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async.cljs", :line 359, :column 7, :end-line 359, :end-column 13, :arglists (quote ([f init ch])), :doc "f should be a function of 2 arguments. Returns a channel containing\n the single result of applying f to init and the first item from the\n channel, then applying f to that result and the 2nd item, etc. If\n the channel closes without yielding items, returns init and f is not\n called. ch must close before reduce produces a result."}, :name cljs.core.async/reduce, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async.cljs", :end-column 13, :method-params ([f init ch]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 359, :end-line 359, :max-fixed-arity 3, :fn-var true, :arglists (quote ([f init ch])), :doc "f should be a function of 2 arguments. Returns a channel containing\n the single result of applying f to init and the first item from the\n channel, then applying f to that result and the 2nd item, etc. If\n the channel closes without yielding items, returns init and f is not\n called. ch must close before reduce produces a result."}, remove> {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async.cljs", :line 819, :column 7, :end-line 819, :end-column 14, :arglists (quote ([p ch])), :doc "Deprecated - this function will be removed. Use transducer instead"}, :name cljs.core.async/remove>, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async.cljs", :end-column 14, :method-params ([p ch]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 819, :end-line 819, :max-fixed-arity 2, :fn-var true, :arglists (quote ([p ch])), :doc "Deprecated - this function will be removed. Use transducer instead"}, timeout {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async.cljs", :line 78, :column 7, :end-line 78, :end-column 14, :arglists (quote ([msecs])), :doc "Returns a channel that will close after msecs"}, :name cljs.core.async/timeout, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async.cljs", :end-column 14, :method-params ([msecs]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 78, :end-line 78, :max-fixed-arity 1, :fn-var true, :arglists (quote ([msecs])), :doc "Returns a channel thLine truncated
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/core\/async.js","sources":["async.cljs?rel=1517021946128"],"lineCount":9016,"mappings":";AAAA;;;;;;;;AAWA,AAAA,6BAAA,qCAAAA,lEAAOE;AAAP,AAAA,IAAAD,WAAA,AAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,OAAAC,yDAAA,CAAA,UAAA;;;KAAA;AAAA,OAAAA,yDAAA,CAAA,UAAA,MAAA,CAAA,UAAA;;;;AAAA,MAAA,KAAAC,MAAA,CAAA,8DAAA,AAAA;;;;;AAAA,AAAA,2DAAA,3DAAOD,sEACHE;AADJ,AACO,8CAAA,vCAACF,qCAAWE;;;AADnB,AAAA,2DAAA,3DAAOF,sEAEHE,EAAEC;AAFN,AAGG,AAAA,GAAA,OAAAC;AAAA;AAAA,AAAA,AAAA;;;;;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,AAAAA,0FAAA,WAAAC,OAAAC;;AAAA,AAAA,IAAAD,aAAA;mDADCH,SAAEC,5DACH,AAAA,YAAAC,iEAAAE;;;AAAA,AAAA,AAAA,AAAAF,iFAAA,WAAAC;;AAAA,AAAA,IAAAA,aAAA;AAAA,AAAAC;;;AAAA,AAAA,AAAA,AAAAF,2FAAAG;;AAAA,AAAA,AAAA,AAAAH,gHAAA,WAEYS;;AAFZ,AAAA,YAAA,RAEYA;AAFZ,AAAA;;;AAAA,AAAA,AAAA,AAAAT,mHAAA,WAGeS;;AAHf,AAAA,YAAA,RAGeA;AAHf,AAGkBV;;;AAHlB,AAAA,AAAA,AAAAC,yGAAA,WAIWS;;AAJX,AAAA,YAAA,RAIWA;AAJX,AAIcX;;;AAJd,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AjC,AAAA,oBAAAI;AAAA,UAAAA,NAASV;AAAT,AAAA,OAAAE,0BACGF;;AADH;;;;AANL,AAAA,0DAAA,1DAAMS,qEASFd,KAAKQ,IAAIL;AATb,AASkB,wDAAA,jDAACW,oCAAKd,KAAKQ,IAAIL;;;AATjC,AAAA,0DAAA,1DAAMW,qEAUFd,KAAKQ,IAAIL,IAAIC;AAVjB,AAWK,IAAAW,qBAAc,AAACC,mDAAUhB,KAAKQ,IAAI,AAAC\/C,qCAAW0C;AAA9C,AAAA,oBAAAY;AAAA,WAAAA,PAASE;AAAT,AACE,UAAA,AAAAV,NAAMF,gCAAKY;AAAX,AACE,oBAAIb;AACF,AAACD,cAAIE;;AACL,4CAAA,5CAACI;;AAAD,AAAe,OAACN,cAAIE;;;;;AACtBA;;AALJ;;;;AAXL,AAAA,oDAAA,pDAAMS;;AAAN,AAmBA,8BAAA,9BAAMI,oEACFlB;AADJ,AAEK,OAACmB,qDAAYnB;;AAGlB,+BAAA,\/BAAOoB,sEACJ5C;AADH,AAEE,IAAM6C,IAAE,KAAAC,MAAY9C;AAApB,AACE,IAAA+C,yBAAY\/C;AAAZ,AAAA,cAAA,VAAUgD;;AAAV,AAAA,GAAA,WAAAD,VAAUC;AAAV,AACE,cAAA,bAAMH,EAAEG;;AADV,eAAA,WAAA,VAAUA;;;;AAAV;;;;AAEA,QAAA,JAAOC;;AAAP,AACE,GAAI,AAAClC,yBAAEkC,EAAEjD;AACP6C;;AACA,AACE,IAAMK,IAAE,AAACC,6BAASF;AAAlB,AACE,CAAMJ,EAAEI,KAAE,CAAMJ,EAAEK;;AAClB,CAAML,EAAEK,KAAED;;AACV,eAAO,KAAA,JAAKA;;;;;;;AAExLine truncated
@@ -0,0 +1,159 @@
;; Copyright (c) Rich Hickey and contributors. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns cljs.core.async.impl.buffers
(:require [cljs.core.async.impl.protocols :as impl]))
;; -----------------------------------------------------------------------------
;; DO NOT USE, this is internal buffer representation
(defn acopy [src src-start dest dest-start len]
(loop [cnt 0]
(when (< cnt len)
(aset dest
(+ dest-start cnt)
(aget src (+ src-start cnt)))
(recur (inc cnt)))))
(deftype RingBuffer [^:mutable head ^:mutable tail ^:mutable length ^:mutable arr]
Object
(pop [_]
(when-not (zero? length)
(let [x (aget arr tail)]
(aset arr tail nil)
(set! tail (js-mod (inc tail) (alength arr)))
(set! length (dec length))
x)))
(unshift [_ x]
(aset arr head x)
(set! head (js-mod (inc head) (alength arr)))
(set! length (inc length))
nil)
(unbounded-unshift [this x]
(if (== (inc length) (alength arr))
(.resize this))
(.unshift this x))
;; Doubles the size of the buffer while retaining all the existing values
(resize
[_]
(let [new-arr-size (* (alength arr) 2)
new-arr (make-array new-arr-size)]
(cond
(< tail head)
(do (acopy arr tail new-arr 0 length)
(set! tail 0)
(set! head length)
(set! arr new-arr))
(> tail head)
(do (acopy arr tail new-arr 0 (- (alength arr) tail))
(acopy arr 0 new-arr (- (alength arr) tail) head)
(set! tail 0)
(set! head length)
(set! arr new-arr))
(== tail head)
(do (set! tail 0)
(set! head 0)
(set! arr new-arr)))))
(cleanup [this keep?]
(dotimes [x length]
(let [v (.pop this)]
(when ^boolean (keep? v)
(.unshift this v))))))
(defn ring-buffer [n]
(assert (> n 0) "Can't create a ring buffer of size 0")
(RingBuffer. 0 0 0 (make-array n)))
;; -----------------------------------------------------------------------------
(deftype FixedBuffer [buf n]
impl/Buffer
(full? [this]
(== (.-length buf) n))
(remove! [this]
(.pop buf))
(add!* [this itm]
(.unbounded-unshift buf itm)
this)
(close-buf! [this])
cljs.core/ICounted
(-count [this]
(.-length buf)))
(defn fixed-buffer [n]
(FixedBuffer. (ring-buffer n) n))
(deftype DroppingBuffer [buf n]
impl/UnblockingBuffer
impl/Buffer
(full? [this]
false)
(remove! [this]
(.pop buf))
(add!* [this itm]
(when-not (== (.-length buf) n)
(.unshift buf itm))
this)
(close-buf! [this])
cljs.core/ICounted
(-count [this]
(.-length buf)))
(defn dropping-buffer [n]
(DroppingBuffer. (ring-buffer n) n))
(deftype SlidingBuffer [buf n]
impl/UnblockingBuffer
impl/Buffer
(full? [this]
false)
(remove! [this]
(.pop buf))
(add!* [this itm]
(when (== (.-length buf) n)
(impl/remove! this))
(.unshift buf itm)
this)
(close-buf! [this])
cljs.core/ICounted
(-count [this]
(.-length buf)))
(defn sliding-buffer [n]
(SlidingBuffer. (ring-buffer n) n))
(defonce ^:private NO-VAL (js/Object.))
(defn- undelivered? [val]
(identical? NO-VAL val))
(deftype PromiseBuffer [^:mutable val]
impl/UnblockingBuffer
impl/Buffer
(full? [_]
false)
(remove! [_]
val)
(add!* [this itm]
(when (undelivered? val)
(set! val itm))
this)
(close-buf! [_]
(when (undelivered? val)
(set! val nil)))
cljs.core/ICounted
(-count [_]
(if (undelivered? val) 0 1)))
(defn promise-buffer []
(PromiseBuffer. NO-VAL))
@@ -0,0 +1 @@
{:rename-macros {}, :renames {}, :externs {Array {}, Error {}, Object {}}, :use-macros {}, :excludes #{}, :name cljs.core.async.impl.buffers, :imports nil, :requires {impl cljs.core.async.impl.protocols, cljs.core.async.impl.protocols cljs.core.async.impl.protocols}, :cljs.spec/speced-vars [], :uses nil, :defs {->PromiseBuffer {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :line 140, :column 10, :end-line 140, :end-column 23, :protocols #{cljs.core/ICounted cljs.core.async.impl.protocols/UnblockingBuffer cljs.core.async.impl.protocols/Buffer}, :skip-protocol-flag #{cljs.core/ICounted}, :factory :positional, :arglists (quote ([val]))}, :protocols #{cljs.core/ICounted cljs.core.async.impl.protocols/UnblockingBuffer cljs.core.async.impl.protocols/Buffer}, :name cljs.core.async.impl.buffers/->PromiseBuffer, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :end-column 23, :method-params ([val]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :factory :positional, :line 140, :end-line 140, :max-fixed-arity 1, :fn-var true, :arglists (quote ([val])), :skip-protocol-flag #{cljs.core/ICounted}}, RingBuffer {:num-fields 4, :protocols #{cljs.core.async.impl.buffers/Object}, :name cljs.core.async.impl.buffers/RingBuffer, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :end-column 20, :type true, :column 10, :line 23, :record false, :end-line 23, :skip-protocol-flag nil}, undelivered? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :line 137, :column 8, :end-line 137, :end-column 20, :private true, :arglists (quote ([val]))}, :private true, :name cljs.core.async.impl.buffers/undelivered?, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :end-column 20, :method-params ([val]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 137, :end-line 137, :max-fixed-arity 1, :fn-var true, :arglists (quote ([val]))}, ->DroppingBuffer {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :line 97, :column 10, :end-line 97, :end-column 24, :protocols #{cljs.core/ICounted cljs.core.async.impl.protocols/UnblockingBuffer cljs.core.async.impl.protocols/Buffer}, :skip-protocol-flag #{cljs.core/ICounted}, :factory :positional, :arglists (quote ([buf n]))}, :protocols #{cljs.core/ICounted cljs.core.async.impl.protocols/UnblockingBuffer cljs.core.async.impl.protocols/Buffer}, :name cljs.core.async.impl.buffers/->DroppingBuffer, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :end-column 24, :method-params ([buf n]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :factory :positional, :line 97, :end-line 97, :max-fixed-arity 2, :fn-var true, :arglists (quote ([buf n])), :skip-protocol-flag #{cljs.core/ICounted}}, dropping-buffer {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :line 113, :column 7, :end-line 113, :end-column 22, :arglists (quote ([n]))}, :name cljs.core.async.impl.buffers/dropping-buffer, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :end-column 22, :method-params ([n]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 113, :end-line 113, :max-fixed-arity 1, :fn-var true, :arglists (quote ([n]))}, fixed-buffer {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :line 94, :column 7, :end-line 94, :end-column 19, :arglists (quote ([n]))}, :name cljs.core.async.impl.buffers/fixed-buffer, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :end-column 19, :method-params ([n]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 94, :end-line 94, :max-fixed-arity 1, :fn-var true, :arglists (quote ([n]))}, ->FixedBuffer {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :line 80, :column 10, :end-line 80, :end-column 21, :protocols #{cljs.core/ICounted cljs.core.async.impl.protocols/Buffer}, :skip-protocol-flag #{cljs.core/ICounted}, :factory :positional, :arglists (quote ([buf n]))}, :protocols #{cljs.core/ICounted cljs.core.async.impl.protocols/Buffer}, :name cljs.core.async.impl.buffers/->FixedBuffer, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/buffers.cljs", :end-column 21, :method-params ([buf n]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :factory :positional, :line 80, :end-line 80, :max-fixed-arity 2, :fn-var true, :arglists (quote ([buf n])), :skip-protocol-flag #{cljs.core/ICounteLine truncated
+451
View File
@@ -0,0 +1,451 @@
// Compiled by ClojureScript 1.9.946 {}
goog.provide('cljs.core.async.impl.buffers');
goog.require('cljs.core');
goog.require('cljs.core.async.impl.protocols');
cljs.core.async.impl.buffers.acopy = (function cljs$core$async$impl$buffers$acopy(src,src_start,dest,dest_start,len){
var cnt = (0);
while(true){
if((cnt < len)){
(dest[(dest_start + cnt)] = (src[(src_start + cnt)]));
var G__40835 = (cnt + (1));
cnt = G__40835;
continue;
} else {
return null;
}
break;
}
});
/**
* @constructor
* @implements {cljs.core.async.impl.buffers.Object}
*/
cljs.core.async.impl.buffers.RingBuffer = (function (head,tail,length,arr){
this.head = head;
this.tail = tail;
this.length = length;
this.arr = arr;
});
cljs.core.async.impl.buffers.RingBuffer.prototype.pop = (function (){
var self__ = this;
var _ = this;
if((self__.length === (0))){
return null;
} else {
var x = (self__.arr[self__.tail]);
(self__.arr[self__.tail] = null);
self__.tail = ((self__.tail + (1)) % self__.arr.length);
self__.length = (self__.length - (1));
return x;
}
});
cljs.core.async.impl.buffers.RingBuffer.prototype.unshift = (function (x){
var self__ = this;
var _ = this;
(self__.arr[self__.head] = x);
self__.head = ((self__.head + (1)) % self__.arr.length);
self__.length = (self__.length + (1));
return null;
});
cljs.core.async.impl.buffers.RingBuffer.prototype.unbounded_unshift = (function (x){
var self__ = this;
var this$ = this;
if(((self__.length + (1)) === self__.arr.length)){
this$.resize();
} else {
}
return this$.unshift(x);
});
cljs.core.async.impl.buffers.RingBuffer.prototype.resize = (function (){
var self__ = this;
var _ = this;
var new_arr_size = (self__.arr.length * (2));
var new_arr = (new Array(new_arr_size));
if((self__.tail < self__.head)){
cljs.core.async.impl.buffers.acopy.call(null,self__.arr,self__.tail,new_arr,(0),self__.length);
self__.tail = (0);
self__.head = self__.length;
return self__.arr = new_arr;
} else {
if((self__.tail > self__.head)){
cljs.core.async.impl.buffers.acopy.call(null,self__.arr,self__.tail,new_arr,(0),(self__.arr.length - self__.tail));
cljs.core.async.impl.buffers.acopy.call(null,self__.arr,(0),new_arr,(self__.arr.length - self__.tail),self__.head);
self__.tail = (0);
self__.head = self__.length;
return self__.arr = new_arr;
} else {
if((self__.tail === self__.head)){
self__.tail = (0);
self__.head = (0);
return self__.arr = new_arr;
} else {
return null;
}
}
}
});
cljs.core.async.impl.buffers.RingBuffer.prototype.cleanup = (function (keep_QMARK_){
var self__ = this;
var this$ = this;
var n__36543__auto__ = self__.length;
var x = (0);
while(true){
if((x < n__36543__auto__)){
var v_40836 = this$.pop();
if(keep_QMARK_.call(null,v_40836)){
this$.unshift(v_40836);
} else {
}
var G__40837 = (x + (1));
x = G__40837;
continue;
} else {
return null;
}
break;
}
});
cljs.core.async.impl.buffers.RingBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta(new cljs.core.Symbol(null,"head","head",869147608,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"tail","tail",494507963,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"length","length",-2065447907,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"arr","arr",2115492975,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
});
cljs.core.async.impl.buffers.RingBuffer.cljs$lang$type = true;
cljs.core.async.impl.buffers.RingBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/RingBuffer";
cljs.core.async.impl.buffers.RingBuffer.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.buffers/RingBuffer");
});
cljs.core.async.impl.buffers.__GT_RingBuffer = (function cljs$core$async$impl$buffers$__GT_RingBuffer(head,tail,length,arr){
return (new cljs.core.async.impl.buffers.RingBuffer(head,tail,length,arr));
});
cljs.core.async.impl.buffers.ring_buffer = (function cljs$core$async$impl$buffers$ring_buffer(n){
if((n > (0))){
} else {
throw (new Error(["Assert failed: ","Can't create a ring buffer of size 0","\n","(> n 0)"].join('')));
}
return (new cljs.core.async.impl.buffers.RingBuffer((0),(0),(0),(new Array(n))));
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.FixedBuffer = (function (buf,n){
this.buf = buf;
this.n = n;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return (self__.buf.length === self__.n);
});
cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.pop();
});
cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
self__.buf.unbounded_unshift(itm);
return this$__$1;
});
cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return null;
});
cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.length;
});
cljs.core.async.impl.buffers.FixedBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.Symbol(null,"n","n",-2092305744,null)], null);
});
cljs.core.async.impl.buffers.FixedBuffer.cljs$lang$type = true;
cljs.core.async.impl.buffers.FixedBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/FixedBuffer";
cljs.core.async.impl.buffers.FixedBuffer.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.buffers/FixedBuffer");
});
cljs.core.async.impl.buffers.__GT_FixedBuffer = (function cljs$core$async$impl$buffers$__GT_FixedBuffer(buf,n){
return (new cljs.core.async.impl.buffers.FixedBuffer(buf,n));
});
cljs.core.async.impl.buffers.fixed_buffer = (function cljs$core$async$impl$buffers$fixed_buffer(n){
return (new cljs.core.async.impl.buffers.FixedBuffer(cljs.core.async.impl.buffers.ring_buffer.call(null,n),n));
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.UnblockingBuffer}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.DroppingBuffer = (function (buf,n){
this.buf = buf;
this.n = n;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$UnblockingBuffer$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return false;
});
cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.pop();
});
cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
if((self__.buf.length === self__.n)){
} else {
self__.buf.unshift(itm);
}
return this$__$1;
});
cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return null;
});
cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.length;
});
cljs.core.async.impl.buffers.DroppingBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.Symbol(null,"n","n",-2092305744,null)], null);
});
cljs.core.async.impl.buffers.DroppingBuffer.cljs$lang$type = true;
cljs.core.async.impl.buffers.DroppingBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/DroppingBuffer";
cljs.core.async.impl.buffers.DroppingBuffer.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.buffers/DroppingBuffer");
});
cljs.core.async.impl.buffers.__GT_DroppingBuffer = (function cljs$core$async$impl$buffers$__GT_DroppingBuffer(buf,n){
return (new cljs.core.async.impl.buffers.DroppingBuffer(buf,n));
});
cljs.core.async.impl.buffers.dropping_buffer = (function cljs$core$async$impl$buffers$dropping_buffer(n){
return (new cljs.core.async.impl.buffers.DroppingBuffer(cljs.core.async.impl.buffers.ring_buffer.call(null,n),n));
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.UnblockingBuffer}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.SlidingBuffer = (function (buf,n){
this.buf = buf;
this.n = n;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$UnblockingBuffer$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return false;
});
cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.pop();
});
cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
if((self__.buf.length === self__.n)){
cljs.core.async.impl.protocols.remove_BANG_.call(null,this$__$1);
} else {
}
self__.buf.unshift(itm);
return this$__$1;
});
cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return null;
});
cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.length;
});
cljs.core.async.impl.buffers.SlidingBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.Symbol(null,"n","n",-2092305744,null)], null);
});
cljs.core.async.impl.buffers.SlidingBuffer.cljs$lang$type = true;
cljs.core.async.impl.buffers.SlidingBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/SlidingBuffer";
cljs.core.async.impl.buffers.SlidingBuffer.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.buffers/SlidingBuffer");
});
cljs.core.async.impl.buffers.__GT_SlidingBuffer = (function cljs$core$async$impl$buffers$__GT_SlidingBuffer(buf,n){
return (new cljs.core.async.impl.buffers.SlidingBuffer(buf,n));
});
cljs.core.async.impl.buffers.sliding_buffer = (function cljs$core$async$impl$buffers$sliding_buffer(n){
return (new cljs.core.async.impl.buffers.SlidingBuffer(cljs.core.async.impl.buffers.ring_buffer.call(null,n),n));
});
if(typeof cljs.core.async.impl.buffers.NO_VAL !== 'undefined'){
} else {
cljs.core.async.impl.buffers.NO_VAL = (new Object());
}
cljs.core.async.impl.buffers.undelivered_QMARK_ = (function cljs$core$async$impl$buffers$undelivered_QMARK_(val){
return (cljs.core.async.impl.buffers.NO_VAL === val);
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.UnblockingBuffer}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.PromiseBuffer = (function (val){
this.val = val;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$UnblockingBuffer$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return false;
});
cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.val;
});
cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
if(cljs.core.truth_(cljs.core.async.impl.buffers.undelivered_QMARK_.call(null,self__.val))){
self__.val = itm;
} else {
}
return this$__$1;
});
cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
if(cljs.core.truth_(cljs.core.async.impl.buffers.undelivered_QMARK_.call(null,self__.val))){
return self__.val = null;
} else {
return null;
}
});
cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
if(cljs.core.truth_(cljs.core.async.impl.buffers.undelivered_QMARK_.call(null,self__.val))){
return (0);
} else {
return (1);
}
});
cljs.core.async.impl.buffers.PromiseBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta(new cljs.core.Symbol(null,"val","val",1769233139,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
});
cljs.core.async.impl.buffers.PromiseBuffer.cljs$lang$type = true;
cljs.core.async.impl.buffers.PromiseBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/PromiseBuffer";
cljs.core.async.impl.buffers.PromiseBuffer.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.buffers/PromiseBuffer");
});
cljs.core.async.impl.buffers.__GT_PromiseBuffer = (function cljs$core$async$impl$buffers$__GT_PromiseBuffer(val){
return (new cljs.core.async.impl.buffers.PromiseBuffer(val));
});
cljs.core.async.impl.buffers.promise_buffer = (function cljs$core$async$impl$buffers$promise_buffer(){
return (new cljs.core.async.impl.buffers.PromiseBuffer(cljs.core.async.impl.buffers.NO_VAL));
});
//# sourceMappingURL=buffers.js.map?rel=1517021944749
@@ -0,0 +1 @@
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/core\/async\/impl\/buffers.js","sources":["buffers.cljs?rel=1517021944750"],"lineCount":451,"mappings":";AAQA;;;AAMA,qCAAA,rCAAMA,kFAAOC,IAAIC,UAAUC,KAAKC,WAAWC;AAA3C,AACE,UAAA,NAAOC;;AAAP,AACE,GAAM,CAAGA,MAAID;AAAb,AACE,CAAMF,KACA,CAAGC,aAAWE,QACd,CAAML,IAAI,CAAGC,YAAUI;;AAC7B,eAAO,OAAA,NAAKA;;;;AAJd;;;;;AAMJ,AAAA;;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,wDAAA,xDAASK;;AAAT,AAAA,QAAA,JAEQM;AAFR,AAGI,GAAU,mBAAA,lBAAOF;AAAjB;;AAAA,AACE,IAAMG,IAAE,CAAMF,WAAIF;AAAlB,AACE,2BAAA,1BAAME,WAAIF;;AACV,AAAMA,cAAK,CAAQ,eAAA,dAAKA,qBAAM,AAASE;;AACvC,AAAMD,gBAAO,iBAAA,hBAAKA;;AAClBG;;;;AARR,AAAA,AAAA,4DAAA,5DAASP,uEAUKO;;AAVd,AAAA,QAAA,JAUYD;AAVZ,AAWI,CAAMD,WAAIH,eAAKK;;AACf,AAAML,cAAK,CAAQ,eAAA,dAAKA,qBAAM,AAASG;;AACvC,AAAMD,gBAAO,iBAAA,hBAAKA;;AAbtB;;;AAAA,AAAA,AAAA,sEAAA,tEAASJ,iFAgBkBO;;AAhB3B,AAAA,YAAA,RAgBsBC;AAhBtB,AAiBI,GAAI,CAAI,iBAAA,hBAAKJ,yBAAQ,AAASC;AAC5B,AAASG;;AADX;;AAEA,OAAUA,cAAKD;;;AAnBnB,AAAA,AAAA,2DAAA,3DAASP;;AAAT,AAAA,QAAA,JAuBKM;AAvBL,AAwBI,IAAMG,eAAa,qBAAA,pBAAG,AAASJ;IACzBK,UAAQ,KAAAC,MAAYF;AAD1B,AAEE,GACC,CAAGN,cA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QI,GAAM,CAAI,AAAUa,sBAAKL;AAAzB,AACE,AAACa,sDAAarB;;AADhB;;AAEA,AAAUa,mBAAIC;;AACdd;;;AAXJ,AAAA,AAAA,qHAAA,rHAASmB,gIAYMnB;;AAZf,AAAA,gBAAA,ZAYeA;AAZf,AAAA;;;AAAA,AAAA,AAAA,yFAAA,zFAASmB,oGAcEnB;;AAdX,AAAA,gBAAA,ZAcWA;AAdX,AAeI,OAAUa;;;AAfd,AAAA,sDAAA,tDAASM;AAAT,AAAA,0FAAA,uDAAA;;;AAAA,AAAA,4DAAA,5DAASA;;AAAT,AAAA,+DAAA,\/DAASA;;AAAT,AAAA,oEAAA,WAAA\/B,oBAAAC,sBAAAC,zHAAS6B;AAAT,AAAA,OAAA5B,2BAAAF,sBAAA;;;AAAA,kDAAA,lDAAS+B,4GAAeP,IAAIL;AAA5B,AAAA,YAAAW,2CAAwBN,IAAIL;;;AAAnBW,AAiBT,8CAAA,9CAAMG,oGAAgBd;AAAtB,AACE,YAAAW,2CAAgB,AAACZ,mDAAYC,GAAGA;;AAElC,GAAA,OAAmBe;AAAnB;AAAA,AAAA,AAAmBA,sCAAO,KAAAC;;AAC1B,kDAAA,lDAAOC,4GAAcC;AAArB,AACE,QAAYH,wCAAOG;;AAErB,AAAA;;;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,wGAAAhB,xGAASiB;;AAAT,AAAA,AAAA,8FAAAjB,9FAASiB;Line truncated
@@ -0,0 +1,192 @@
;; Copyright (c) Rich Hickey and contributors. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns cljs.core.async.impl.channels
(:require [cljs.core.async.impl.protocols :as impl]
[cljs.core.async.impl.dispatch :as dispatch]
[cljs.core.async.impl.buffers :as buffers]))
(defn box [val]
(reify cljs.core/IDeref
(-deref [_] val)))
(deftype PutBox [handler val])
(defn put-active? [box]
(impl/active? (.-handler box)))
(def ^:const MAX_DIRTY 64)
(defprotocol MMC
(abort [this]))
(deftype ManyToManyChannel [takes ^:mutable dirty-takes puts ^:mutable dirty-puts ^not-native buf ^:mutable closed add!]
MMC
(abort [this]
(loop []
(let [putter (.pop puts)]
(when-not (nil? putter)
(let [^not-native put-handler (.-handler putter)
val (.-val putter)]
(if ^boolean (impl/active? put-handler)
(let [put-cb (impl/commit put-handler)]
(dispatch/run #(put-cb true)))
(recur))))))
(.cleanup puts (constantly false))
(impl/close! this))
impl/WritePort
(put! [this val ^not-native handler]
(assert (not (nil? val)) "Can't put nil in on a channel")
;; bug in CLJS compiler boolean inference - David
(let [^boolean closed closed]
(if (or closed (not ^boolean (impl/active? handler)))
(box (not closed))
(if (and buf (not (impl/full? buf)))
(do
(impl/commit handler)
(let [done? (reduced? (add! buf val))
take-cbs (loop [takers []]
(if (and (pos? (.-length takes)) (pos? (count buf)))
(let [^not-native taker (.pop takes)]
(if ^boolean (impl/active? taker)
(let [ret (impl/commit taker)
val (impl/remove! buf)]
(recur (conj takers (fn [] (ret val)))))
(recur takers)))
takers))]
(when done? (abort this))
(when (seq take-cbs)
(doseq [f take-cbs]
(dispatch/run f)))
(box true)))
(let [taker (loop []
(let [^not-native taker (.pop takes)]
(when taker
(if (impl/active? taker)
taker
(recur)))))]
(if taker
(let [take-cb (impl/commit taker)]
(impl/commit handler)
(dispatch/run (fn [] (take-cb val)))
(box true))
(do
(if (> dirty-puts MAX_DIRTY)
(do (set! dirty-puts 0)
(.cleanup puts put-active?))
(set! dirty-puts (inc dirty-puts)))
(when (impl/blockable? handler)
(assert (< (.-length puts) impl/MAX-QUEUE-SIZE)
(str "No more than " impl/MAX-QUEUE-SIZE
" pending puts are allowed on a single channel."
" Consider using a windowed buffer."))
(.unbounded-unshift puts (PutBox. handler val)))
nil)))))))
impl/ReadPort
(take! [this ^not-native handler]
(if (not ^boolean (impl/active? handler))
nil
(if (and (not (nil? buf)) (pos? (count buf)))
(do
(if-let [take-cb (impl/commit handler)]
(let [val (impl/remove! buf)
[done? cbs] (when (pos? (.-length puts))
(loop [cbs []]
(let [putter (.pop puts)
^not-native put-handler (.-handler putter)
val (.-val putter)
cb (and ^boolean (impl/active? put-handler) (impl/commit put-handler))
cbs (if cb (conj cbs cb) cbs)
done? (when cb (reduced? (add! buf val)))]
(if (and (not done?) (not (impl/full? buf)) (pos? (.-length puts)))
(recur cbs)
[done? cbs]))))]
(when done?
(abort this))
(doseq [cb cbs]
(dispatch/run #(cb true)))
(box val))))
(let [putter (loop []
(let [putter (.pop puts)]
(when putter
(if ^boolean (impl/active? (.-handler putter))
putter
(recur)))))]
(if putter
(let [put-cb (impl/commit (.-handler putter))]
(impl/commit handler)
(dispatch/run #(put-cb true))
(box (.-val putter)))
(if closed
(do
(when buf (add! buf))
(if (and (impl/active? handler) (impl/commit handler))
(let [has-val (and buf (pos? (count buf)))]
(let [val (when has-val (impl/remove! buf))]
(box val)))
nil))
(do
(if (> dirty-takes MAX_DIRTY)
(do (set! dirty-takes 0)
(.cleanup takes impl/active?))
(set! dirty-takes (inc dirty-takes)))
(when (impl/blockable? handler)
(assert (< (.-length takes) impl/MAX-QUEUE-SIZE)
(str "No more than " impl/MAX-QUEUE-SIZE
" pending takes are allowed on a single channel."))
(.unbounded-unshift takes handler))
nil)))))))
impl/Channel
(closed? [_] closed)
(close! [this]
(if ^boolean closed
nil
(do (set! closed true)
(when (and buf (zero? (.-length puts)))
(add! buf))
(loop []
(let [^not-native taker (.pop takes)]
(when-not (nil? taker)
(when ^boolean (impl/active? taker)
(let [take-cb (impl/commit taker)
val (when (and buf (pos? (count buf))) (impl/remove! buf))]
(dispatch/run (fn [] (take-cb val)))))
(recur))))
(when buf (impl/close-buf! buf))
nil))))
(defn- ex-handler [ex]
(.log js/console ex)
nil)
(defn- handle [buf exh t]
(let [else ((or exh ex-handler) t)]
(if (nil? else)
buf
(impl/add! buf else))))
(defn chan
([buf] (chan buf nil))
([buf xform] (chan buf xform nil))
([buf xform exh]
(ManyToManyChannel. (buffers/ring-buffer 32) 0 (buffers/ring-buffer 32)
0 buf false
(let [add! (if xform (xform impl/add!) impl/add!)]
(fn
([buf]
(try
(add! buf)
(catch :default t
(handle buf exh t))))
([buf val]
(try
(add! buf val)
(catch :default t
(handle buf exh t)))))))))
@@ -0,0 +1 @@
{:rename-macros {}, :renames {}, :externs {Error {}, console {log {}}}, :use-macros {}, :excludes #{}, :name cljs.core.async.impl.channels, :imports nil, :requires {impl cljs.core.async.impl.protocols, cljs.core.async.impl.protocols cljs.core.async.impl.protocols, dispatch cljs.core.async.impl.dispatch, cljs.core.async.impl.dispatch cljs.core.async.impl.dispatch, buffers cljs.core.async.impl.buffers, cljs.core.async.impl.buffers cljs.core.async.impl.buffers}, :cljs.spec/speced-vars [], :uses nil, :defs {put-active? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :line 22, :column 7, :end-line 22, :end-column 18, :arglists (quote ([box]))}, :name cljs.core.async.impl.channels/put-active?, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :end-column 18, :method-params ([box]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 22, :end-line 22, :max-fixed-arity 1, :fn-var true, :arglists (quote ([box]))}, chan {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :line 175, :column 7, :end-line 175, :end-column 11, :arglists (quote ([buf] [buf xform] [buf xform exh])), :top-fn {:variadic false, :max-fixed-arity 3, :method-params ([buf] [buf xform] [buf xform exh]), :arglists ([buf] [buf xform] [buf xform exh]), :arglists-meta (nil nil nil)}}, :name cljs.core.async.impl.channels/chan, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :end-column 11, :top-fn {:variadic false, :max-fixed-arity 3, :method-params ([buf] [buf xform] [buf xform exh]), :arglists ([buf] [buf xform] [buf xform exh]), :arglists-meta (nil nil nil)}, :method-params ([buf] [buf xform] [buf xform exh]), :protocol-impl nil, :arglists-meta (nil nil nil), :column 1, :line 175, :end-line 175, :max-fixed-arity 3, :fn-var true, :arglists ([buf] [buf xform] [buf xform exh])}, t_cljs$core$async$impl$channels40845 {:num-fields 2, :protocols #{cljs.core/IMeta cljs.core/IDeref cljs.core/IWithMeta}, :name cljs.core.async.impl.channels/t_cljs$core$async$impl$channels40845, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :type true, :anonymous true, :column 3, :line 17, :record false, :skip-protocol-flag #{cljs.core/IMeta cljs.core/IDeref cljs.core/IWithMeta}}, box {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :line 16, :column 7, :end-line 16, :end-column 10, :arglists (quote ([val]))}, :name cljs.core.async.impl.channels/box, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :end-column 10, :method-params ([val]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 16, :end-line 16, :max-fixed-arity 1, :fn-var true, :arglists (quote ([val]))}, MMC {:meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :line 27, :column 14, :end-line 27, :end-column 17, :doc nil, :protocol-symbol true, :jsdoc ("@interface"), :protocol-info {:methods {abort [[this]]}}}, :protocol-symbol true, :name cljs.core.async.impl.channels/MMC, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :end-column 17, :column 1, :line 27, :protocol-info {:methods {abort [[this]]}}, :info nil, :end-line 27, :tag any, :impls #{cljs.core.async.impl.channels/ManyToManyChannel}, :doc nil, :jsdoc ("@interface")}, ->PutBox {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :line 20, :column 10, :end-line 20, :end-column 16, :protocols #{}, :skip-protocol-flag nil, :factory :positional, :arglists (quote ([handler val]))}, :protocols #{}, :name cljs.core.async.impl.channels/->PutBox, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :end-column 16, :method-params ([handler val]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :factory :positional, :line 20, :end-line 20, :max-fixed-arity 2, :fn-var true, :arglists (quote ([handler val])), :skip-protocol-flag nil}, abort {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :line 28, :column 4, :end-line 28, :end-column 9, :protocol cljs.core.async.impl.channels/MMC, :doc nil, :arglists (quote ([this]))}, :protocol cljs.core.async.impl.channels/MMC, :name cljs.core.async.impl.channels/abort, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/channels.cljs", :end-column 9, :method-params ([this]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 27, :end-line 28, :max-fixed-arity 1, :fn-var true, :arglists (quote ([this])), :doc nil}, ex-handler {:protocol-inline nil, :meta {:file Line truncated
@@ -0,0 +1,672 @@
// Compiled by ClojureScript 1.9.946 {}
goog.provide('cljs.core.async.impl.channels');
goog.require('cljs.core');
goog.require('cljs.core.async.impl.protocols');
goog.require('cljs.core.async.impl.dispatch');
goog.require('cljs.core.async.impl.buffers');
cljs.core.async.impl.channels.box = (function cljs$core$async$impl$channels$box(val){
if(typeof cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845 !== 'undefined'){
} else {
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IDeref}
* @implements {cljs.core.IWithMeta}
*/
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845 = (function (val,meta40846){
this.val = val;
this.meta40846 = meta40846;
this.cljs$lang$protocol_mask$partition0$ = 425984;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_40847,meta40846__$1){
var self__ = this;
var _40847__$1 = this;
return (new cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845(self__.val,meta40846__$1));
});
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_40847){
var self__ = this;
var _40847__$1 = this;
return self__.meta40846;
});
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845.prototype.cljs$core$IDeref$_deref$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.val;
});
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"val","val",1769233139,null),new cljs.core.Symbol(null,"meta40846","meta40846",1979741167,null)], null);
});
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845.cljs$lang$type = true;
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845.cljs$lang$ctorStr = "cljs.core.async.impl.channels/t_cljs$core$async$impl$channels40845";
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.channels/t_cljs$core$async$impl$channels40845");
});
cljs.core.async.impl.channels.__GT_t_cljs$core$async$impl$channels40845 = (function cljs$core$async$impl$channels$box_$___GT_t_cljs$core$async$impl$channels40845(val__$1,meta40846){
return (new cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845(val__$1,meta40846));
});
}
return (new cljs.core.async.impl.channels.t_cljs$core$async$impl$channels40845(val,cljs.core.PersistentArrayMap.EMPTY));
});
/**
* @constructor
*/
cljs.core.async.impl.channels.PutBox = (function (handler,val){
this.handler = handler;
this.val = val;
});
cljs.core.async.impl.channels.PutBox.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"handler","handler",1444934915,null),new cljs.core.Symbol(null,"val","val",1769233139,null)], null);
});
cljs.core.async.impl.channels.PutBox.cljs$lang$type = true;
cljs.core.async.impl.channels.PutBox.cljs$lang$ctorStr = "cljs.core.async.impl.channels/PutBox";
cljs.core.async.impl.channels.PutBox.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.channels/PutBox");
});
cljs.core.async.impl.channels.__GT_PutBox = (function cljs$core$async$impl$channels$__GT_PutBox(handler,val){
return (new cljs.core.async.impl.channels.PutBox(handler,val));
});
cljs.core.async.impl.channels.put_active_QMARK_ = (function cljs$core$async$impl$channels$put_active_QMARK_(box){
return cljs.core.async.impl.protocols.active_QMARK_.call(null,box.handler);
});
cljs.core.async.impl.channels.MAX_DIRTY = (64);
/**
* @interface
*/
cljs.core.async.impl.channels.MMC = function(){};
cljs.core.async.impl.channels.abort = (function cljs$core$async$impl$channels$abort(this$){
if((!((this$ == null))) && (!((this$.cljs$core$async$impl$channels$MMC$abort$arity$1 == null)))){
return this$.cljs$core$async$impl$channels$MMC$abort$arity$1(this$);
} else {
var x__36231__auto__ = (((this$ == null))?null:this$);
var m__36232__auto__ = (cljs.core.async.impl.channels.abort[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,this$);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.channels.abort["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,this$);
} else {
throw cljs.core.missing_protocol.call(null,"MMC.abort",this$);
}
}
}
});
/**
* @constructor
* @implements {cljs.core.async.impl.channels.MMC}
* @implements {cljs.core.async.impl.protocols.Channel}
* @implements {cljs.core.async.impl.protocols.WritePort}
* @implements {cljs.core.async.impl.protocols.ReadPort}
*/
cljs.core.async.impl.channels.ManyToManyChannel = (function (takes,dirty_takes,puts,dirty_puts,buf,closed,add_BANG_){
this.takes = takes;
this.dirty_takes = dirty_takes;
this.puts = puts;
this.dirty_puts = dirty_puts;
this.buf = buf;
this.closed = closed;
this.add_BANG_ = add_BANG_;
});
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$channels$MMC$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$channels$MMC$abort$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
while(true){
var putter_40859 = self__.puts.pop();
if((putter_40859 == null)){
} else {
var put_handler_40860 = putter_40859.handler;
var val_40861 = putter_40859.val;
if(cljs.core.async.impl.protocols.active_QMARK_.call(null,put_handler_40860)){
var put_cb_40862 = cljs.core.async.impl.protocols.commit.call(null,put_handler_40860);
cljs.core.async.impl.dispatch.run.call(null,((function (put_cb_40862,put_handler_40860,val_40861,putter_40859,this$__$1){
return (function (){
return put_cb_40862.call(null,true);
});})(put_cb_40862,put_handler_40860,val_40861,putter_40859,this$__$1))
);
} else {
continue;
}
}
break;
}
self__.puts.cleanup(cljs.core.constantly.call(null,false));
return cljs.core.async.impl.protocols.close_BANG_.call(null,this$__$1);
});
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 = (function (this$,val,handler){
var self__ = this;
var this$__$1 = this;
if(!((val == null))){
} else {
throw (new Error(["Assert failed: ","Can't put nil in on a channel","\n","(not (nil? val))"].join('')));
}
var closed__$1 = self__.closed;
if((closed__$1) || (!(cljs.core.async.impl.protocols.active_QMARK_.call(null,handler)))){
return cljs.core.async.impl.channels.box.call(null,!(closed__$1));
} else {
if(cljs.core.truth_((function (){var and__35486__auto__ = self__.buf;
if(cljs.core.truth_(and__35486__auto__)){
return cljs.core.not.call(null,cljs.core.async.impl.protocols.full_QMARK_.call(null,self__.buf));
} else {
return and__35486__auto__;
}
})())){
cljs.core.async.impl.protocols.commit.call(null,handler);
var done_QMARK_ = cljs.core.reduced_QMARK_.call(null,self__.add_BANG_.call(null,self__.buf,val));
var take_cbs = (function (){var takers = cljs.core.PersistentVector.EMPTY;
while(true){
if(((self__.takes.length > (0))) && ((cljs.core.count.call(null,self__.buf) > (0)))){
var taker = self__.takes.pop();
if(cljs.core.async.impl.protocols.active_QMARK_.call(null,taker)){
var ret = cljs.core.async.impl.protocols.commit.call(null,taker);
var val__$1 = cljs.core.async.impl.protocols.remove_BANG_.call(null,self__.buf);
var G__40863 = cljs.core.conj.call(null,takers,((function (takers,ret,val__$1,taker,done_QMARK_,closed__$1,this$__$1){
return (function (){
return ret.call(null,val__$1);
});})(takers,ret,val__$1,taker,done_QMARK_,closed__$1,this$__$1))
);
takers = G__40863;
continue;
} else {
var G__40864 = takers;
takers = G__40864;
continue;
}
} else {
return takers;
}
break;
}
})();
if(done_QMARK_){
cljs.core.async.impl.channels.abort.call(null,this$__$1);
} else {
}
if(cljs.core.seq.call(null,take_cbs)){
var seq__40848_40865 = cljs.core.seq.call(null,take_cbs);
var chunk__40849_40866 = null;
var count__40850_40867 = (0);
var i__40851_40868 = (0);
while(true){
if((i__40851_40868 < count__40850_40867)){
var f_40869 = cljs.core._nth.call(null,chunk__40849_40866,i__40851_40868);
cljs.core.async.impl.dispatch.run.call(null,f_40869);
var G__40870 = seq__40848_40865;
var G__40871 = chunk__40849_40866;
var G__40872 = count__40850_40867;
var G__40873 = (i__40851_40868 + (1));
seq__40848_40865 = G__40870;
chunk__40849_40866 = G__40871;
count__40850_40867 = G__40872;
i__40851_40868 = G__40873;
continue;
} else {
var temp__5457__auto___40874 = cljs.core.seq.call(null,seq__40848_40865);
if(temp__5457__auto___40874){
var seq__40848_40875__$1 = temp__5457__auto___40874;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__40848_40875__$1)){
var c__36429__auto___40876 = cljs.core.chunk_first.call(null,seq__40848_40875__$1);
var G__40877 = cljs.core.chunk_rest.call(null,seq__40848_40875__$1);
var G__40878 = c__36429__auto___40876;
var G__40879 = cljs.core.count.call(null,c__36429__auto___40876);
var G__40880 = (0);
seq__40848_40865 = G__40877;
chunk__40849_40866 = G__40878;
count__40850_40867 = G__40879;
i__40851_40868 = G__40880;
continue;
} else {
var f_40881 = cljs.core.first.call(null,seq__40848_40875__$1);
cljs.core.async.impl.dispatch.run.call(null,f_40881);
var G__40882 = cljs.core.next.call(null,seq__40848_40875__$1);
var G__40883 = null;
var G__40884 = (0);
var G__40885 = (0);
seq__40848_40865 = G__40882;
chunk__40849_40866 = G__40883;
count__40850_40867 = G__40884;
i__40851_40868 = G__40885;
continue;
}
} else {
}
}
break;
}
} else {
}
return cljs.core.async.impl.channels.box.call(null,true);
} else {
var taker = (function (){while(true){
var taker = self__.takes.pop();
if(cljs.core.truth_(taker)){
if(cljs.core.truth_(cljs.core.async.impl.protocols.active_QMARK_.call(null,taker))){
return taker;
} else {
continue;
}
} else {
return null;
}
break;
}
})();
if(cljs.core.truth_(taker)){
var take_cb = cljs.core.async.impl.protocols.commit.call(null,taker);
cljs.core.async.impl.protocols.commit.call(null,handler);
cljs.core.async.impl.dispatch.run.call(null,((function (take_cb,taker,closed__$1,this$__$1){
return (function (){
return take_cb.call(null,val);
});})(take_cb,taker,closed__$1,this$__$1))
);
return cljs.core.async.impl.channels.box.call(null,true);
} else {
if((self__.dirty_puts > (64))){
self__.dirty_puts = (0);
self__.puts.cleanup(cljs.core.async.impl.channels.put_active_QMARK_);
} else {
self__.dirty_puts = (self__.dirty_puts + (1));
}
if(cljs.core.truth_(cljs.core.async.impl.protocols.blockable_QMARK_.call(null,handler))){
if((self__.puts.length < (1024))){
} else {
throw (new Error(["Assert failed: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(["No more than ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((1024))," pending puts are allowed on a single channel."," Consider using a windowed buffer."].join('')),"\n","(< (.-length puts) impl/MAX-QUEUE-SIZE)"].join('')));
}
self__.puts.unbounded_unshift((new cljs.core.async.impl.channels.PutBox(handler,val)));
} else {
}
return null;
}
}
}
});
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2 = (function (this$,handler){
var self__ = this;
var this$__$1 = this;
if(!(cljs.core.async.impl.protocols.active_QMARK_.call(null,handler))){
return null;
} else {
if((!((self__.buf == null))) && ((cljs.core.count.call(null,self__.buf) > (0)))){
var temp__5455__auto__ = cljs.core.async.impl.protocols.commit.call(null,handler);
if(cljs.core.truth_(temp__5455__auto__)){
var take_cb = temp__5455__auto__;
var val = cljs.core.async.impl.protocols.remove_BANG_.call(null,self__.buf);
var vec__40852 = (((self__.puts.length > (0)))?(function (){var cbs = cljs.core.PersistentVector.EMPTY;
while(true){
var putter = self__.puts.pop();
var put_handler = putter.handler;
var val__$1 = putter.val;
var cb = (function (){var and__35486__auto__ = cljs.core.async.impl.protocols.active_QMARK_.call(null,put_handler);
if(and__35486__auto__){
return cljs.core.async.impl.protocols.commit.call(null,put_handler);
} else {
return and__35486__auto__;
}
})();
var cbs__$1 = (cljs.core.truth_(cb)?cljs.core.conj.call(null,cbs,cb):cbs);
var done_QMARK_ = (cljs.core.truth_(cb)?cljs.core.reduced_QMARK_.call(null,self__.add_BANG_.call(null,self__.buf,val__$1)):null);
if((cljs.core.not.call(null,done_QMARK_)) && (cljs.core.not.call(null,cljs.core.async.impl.protocols.full_QMARK_.call(null,self__.buf))) && ((self__.puts.length > (0)))){
var G__40886 = cbs__$1;
cbs = G__40886;
continue;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [done_QMARK_,cbs__$1], null);
}
break;
}
})():null);
var done_QMARK_ = cljs.core.nth.call(null,vec__40852,(0),null);
var cbs = cljs.core.nth.call(null,vec__40852,(1),null);
if(cljs.core.truth_(done_QMARK_)){
cljs.core.async.impl.channels.abort.call(null,this$__$1);
} else {
}
var seq__40855_40887 = cljs.core.seq.call(null,cbs);
var chunk__40856_40888 = null;
var count__40857_40889 = (0);
var i__40858_40890 = (0);
while(true){
if((i__40858_40890 < count__40857_40889)){
var cb_40891 = cljs.core._nth.call(null,chunk__40856_40888,i__40858_40890);
cljs.core.async.impl.dispatch.run.call(null,((function (seq__40855_40887,chunk__40856_40888,count__40857_40889,i__40858_40890,cb_40891,val,vec__40852,done_QMARK_,cbs,take_cb,temp__5455__auto__,this$__$1){
return (function (){
return cb_40891.call(null,true);
});})(seq__40855_40887,chunk__40856_40888,count__40857_40889,i__40858_40890,cb_40891,val,vec__40852,done_QMARK_,cbs,take_cb,temp__5455__auto__,this$__$1))
);
var G__40892 = seq__40855_40887;
var G__40893 = chunk__40856_40888;
var G__40894 = count__40857_40889;
var G__40895 = (i__40858_40890 + (1));
seq__40855_40887 = G__40892;
chunk__40856_40888 = G__40893;
count__40857_40889 = G__40894;
i__40858_40890 = G__40895;
continue;
} else {
var temp__5457__auto___40896 = cljs.core.seq.call(null,seq__40855_40887);
if(temp__5457__auto___40896){
var seq__40855_40897__$1 = temp__5457__auto___40896;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__40855_40897__$1)){
var c__36429__auto___40898 = cljs.core.chunk_first.call(null,seq__40855_40897__$1);
var G__40899 = cljs.core.chunk_rest.call(null,seq__40855_40897__$1);
var G__40900 = c__36429__auto___40898;
var G__40901 = cljs.core.count.call(null,c__36429__auto___40898);
var G__40902 = (0);
seq__40855_40887 = G__40899;
chunk__40856_40888 = G__40900;
count__40857_40889 = G__40901;
i__40858_40890 = G__40902;
continue;
} else {
var cb_40903 = cljs.core.first.call(null,seq__40855_40897__$1);
cljs.core.async.impl.dispatch.run.call(null,((function (seq__40855_40887,chunk__40856_40888,count__40857_40889,i__40858_40890,cb_40903,seq__40855_40897__$1,temp__5457__auto___40896,val,vec__40852,done_QMARK_,cbs,take_cb,temp__5455__auto__,this$__$1){
return (function (){
return cb_40903.call(null,true);
});})(seq__40855_40887,chunk__40856_40888,count__40857_40889,i__40858_40890,cb_40903,seq__40855_40897__$1,temp__5457__auto___40896,val,vec__40852,done_QMARK_,cbs,take_cb,temp__5455__auto__,this$__$1))
);
var G__40904 = cljs.core.next.call(null,seq__40855_40897__$1);
var G__40905 = null;
var G__40906 = (0);
var G__40907 = (0);
seq__40855_40887 = G__40904;
chunk__40856_40888 = G__40905;
count__40857_40889 = G__40906;
i__40858_40890 = G__40907;
continue;
}
} else {
}
}
break;
}
return cljs.core.async.impl.channels.box.call(null,val);
} else {
return null;
}
} else {
var putter = (function (){while(true){
var putter = self__.puts.pop();
if(cljs.core.truth_(putter)){
if(cljs.core.async.impl.protocols.active_QMARK_.call(null,putter.handler)){
return putter;
} else {
continue;
}
} else {
return null;
}
break;
}
})();
if(cljs.core.truth_(putter)){
var put_cb = cljs.core.async.impl.protocols.commit.call(null,putter.handler);
cljs.core.async.impl.protocols.commit.call(null,handler);
cljs.core.async.impl.dispatch.run.call(null,((function (put_cb,putter,this$__$1){
return (function (){
return put_cb.call(null,true);
});})(put_cb,putter,this$__$1))
);
return cljs.core.async.impl.channels.box.call(null,putter.val);
} else {
if(cljs.core.truth_(self__.closed)){
if(cljs.core.truth_(self__.buf)){
self__.add_BANG_.call(null,self__.buf);
} else {
}
if(cljs.core.truth_((function (){var and__35486__auto__ = cljs.core.async.impl.protocols.active_QMARK_.call(null,handler);
if(cljs.core.truth_(and__35486__auto__)){
return cljs.core.async.impl.protocols.commit.call(null,handler);
} else {
return and__35486__auto__;
}
})())){
var has_val = (function (){var and__35486__auto__ = self__.buf;
if(cljs.core.truth_(and__35486__auto__)){
return (cljs.core.count.call(null,self__.buf) > (0));
} else {
return and__35486__auto__;
}
})();
var val = (cljs.core.truth_(has_val)?cljs.core.async.impl.protocols.remove_BANG_.call(null,self__.buf):null);
return cljs.core.async.impl.channels.box.call(null,val);
} else {
return null;
}
} else {
if((self__.dirty_takes > (64))){
self__.dirty_takes = (0);
self__.takes.cleanup(cljs.core.async.impl.protocols.active_QMARK_);
} else {
self__.dirty_takes = (self__.dirty_takes + (1));
}
if(cljs.core.truth_(cljs.core.async.impl.protocols.blockable_QMARK_.call(null,handler))){
if((self__.takes.length < (1024))){
} else {
throw (new Error(["Assert failed: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(["No more than ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((1024))," pending takes are allowed on a single channel."].join('')),"\n","(< (.-length takes) impl/MAX-QUEUE-SIZE)"].join('')));
}
self__.takes.unbounded_unshift(handler);
} else {
}
return null;
}
}
}
}
});
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.closed;
});
cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
if(self__.closed){
return null;
} else {
self__.closed = true;
if(cljs.core.truth_((function (){var and__35486__auto__ = self__.buf;
if(cljs.core.truth_(and__35486__auto__)){
return (self__.puts.length === (0));
} else {
return and__35486__auto__;
}
})())){
self__.add_BANG_.call(null,self__.buf);
} else {
}
while(true){
var taker_40908 = self__.takes.pop();
if((taker_40908 == null)){
} else {
if(cljs.core.async.impl.protocols.active_QMARK_.call(null,taker_40908)){
var take_cb_40909 = cljs.core.async.impl.protocols.commit.call(null,taker_40908);
var val_40910 = (cljs.core.truth_((function (){var and__35486__auto__ = self__.buf;
if(cljs.core.truth_(and__35486__auto__)){
return (cljs.core.count.call(null,self__.buf) > (0));
} else {
return and__35486__auto__;
}
})())?cljs.core.async.impl.protocols.remove_BANG_.call(null,self__.buf):null);
cljs.core.async.impl.dispatch.run.call(null,((function (take_cb_40909,val_40910,taker_40908,this$__$1){
return (function (){
return take_cb_40909.call(null,val_40910);
});})(take_cb_40909,val_40910,taker_40908,this$__$1))
);
} else {
}
continue;
}
break;
}
if(cljs.core.truth_(self__.buf)){
cljs.core.async.impl.protocols.close_buf_BANG_.call(null,self__.buf);
} else {
}
return null;
}
});
cljs.core.async.impl.channels.ManyToManyChannel.getBasis = (function (){
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"takes","takes",298247964,null),cljs.core.with_meta(new cljs.core.Symbol(null,"dirty-takes","dirty-takes",575642138,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"puts","puts",-1883877054,null),cljs.core.with_meta(new cljs.core.Symbol(null,"dirty-puts","dirty-puts",57041148,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol(null,"not-native","not-native",-236392494,null)], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"closed","closed",720856168,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"add!","add!",2046056845,null)], null);
});
cljs.core.async.impl.channels.ManyToManyChannel.cljs$lang$type = true;
cljs.core.async.impl.channels.ManyToManyChannel.cljs$lang$ctorStr = "cljs.core.async.impl.channels/ManyToManyChannel";
cljs.core.async.impl.channels.ManyToManyChannel.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.channels/ManyToManyChannel");
});
cljs.core.async.impl.channels.__GT_ManyToManyChannel = (function cljs$core$async$impl$channels$__GT_ManyToManyChannel(takes,dirty_takes,puts,dirty_puts,buf,closed,add_BANG_){
return (new cljs.core.async.impl.channels.ManyToManyChannel(takes,dirty_takes,puts,dirty_puts,buf,closed,add_BANG_));
});
cljs.core.async.impl.channels.ex_handler = (function cljs$core$async$impl$channels$ex_handler(ex){
console.log(ex);
return null;
});
cljs.core.async.impl.channels.handle = (function cljs$core$async$impl$channels$handle(buf,exh,t){
var else$ = (function (){var or__35498__auto__ = exh;
if(cljs.core.truth_(or__35498__auto__)){
return or__35498__auto__;
} else {
return cljs.core.async.impl.channels.ex_handler;
}
})().call(null,t);
if((else$ == null)){
return buf;
} else {
return cljs.core.async.impl.protocols.add_BANG_.call(null,buf,else$);
}
});
cljs.core.async.impl.channels.chan = (function cljs$core$async$impl$channels$chan(var_args){
var G__40912 = arguments.length;
switch (G__40912) {
case 1:
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
case 3:
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$1 = (function (buf){
return cljs.core.async.impl.channels.chan.call(null,buf,null);
});
cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$2 = (function (buf,xform){
return cljs.core.async.impl.channels.chan.call(null,buf,xform,null);
});
cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$3 = (function (buf,xform,exh){
return (new cljs.core.async.impl.channels.ManyToManyChannel(cljs.core.async.impl.buffers.ring_buffer.call(null,(32)),(0),cljs.core.async.impl.buffers.ring_buffer.call(null,(32)),(0),buf,false,(function (){var add_BANG_ = (cljs.core.truth_(xform)?xform.call(null,cljs.core.async.impl.protocols.add_BANG_):cljs.core.async.impl.protocols.add_BANG_);
return ((function (add_BANG_){
return (function() {
var G__40916 = null;
var G__40916__1 = (function (buf__$1){
try{return add_BANG_.call(null,buf__$1);
}catch (e40913){var t = e40913;
return cljs.core.async.impl.channels.handle.call(null,buf__$1,exh,t);
}});
var G__40916__2 = (function (buf__$1,val){
try{return add_BANG_.call(null,buf__$1,val);
}catch (e40914){var t = e40914;
return cljs.core.async.impl.channels.handle.call(null,buf__$1,exh,t);
}});
G__40916 = function(buf__$1,val){
switch(arguments.length){
case 1:
return G__40916__1.call(this,buf__$1);
case 2:
return G__40916__2.call(this,buf__$1,val);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
G__40916.cljs$core$IFn$_invoke$arity$1 = G__40916__1;
G__40916.cljs$core$IFn$_invoke$arity$2 = G__40916__2;
return G__40916;
})()
;})(add_BANG_))
})()));
});
cljs.core.async.impl.channels.chan.cljs$lang$maxFixedArity = 3;
//# sourceMappingURL=channels.js.map?rel=1517021944834
@@ -0,0 +1 @@
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/core\/async\/impl\/channels.js","sources":["channels.cljs?rel=1517021944836"],"lineCount":672,"mappings":";AAQA;;;;;AAOA,oCAAA,pCAAMA,gFAAKC;AAAX,AACE,AAAA,GAAA,OAAAC;AAAA;AAAA,AAAA,AAAA;;;;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,AAAAA,sHAAA,WAAAC,OAAAC;;AAAA,AAAA,IAAAD,aAAA;+EADSF,\/EACT,AAAA,YAAAC,8EAAAE;;;AAAA,AAAA,AAAA,AAAAF,6GAAA,WAAAC;;AAAA,AAAA,IAAAA,aAAA;AAAA,AAAAC;;;AAAA,AAAA,AAAA,AAAAF,+GAAA,WACWQ;;AADX,AAAA,YAAA,RACWA;AADX,AACcT;;;AAD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AA,IAAA,7CACaE;AADb,AAYE,oBAAM7B;AAAN,AACE,AAACvB,8CAAMC;;AADT;;AAEA,IAAAqD,mBAAA,AAAAtB,wBAAWoB;IAAXG,qBAAA;IAAAC,qBAAA;IAAAC,iBAAA;;AAAA,AAAA,GAAA,AAAA,CAAAA,iBAAAD;AAAA,eAAA,AAAAnB,yBAAAkB,mBAAAE,vDAAQJ;AAAR,AAAA,AACE,4CAAA,5CAACrC;;AAALine truncated
@@ -0,0 +1,37 @@
(ns cljs.core.async.impl.dispatch
(:require [cljs.core.async.impl.buffers :as buffers]
[goog.async.nextTick]))
(def tasks (buffers/ring-buffer 32))
(def running? false)
(def queued? false)
(def TASK_BATCH_SIZE 1024)
(declare queue-dispatcher)
(defn process-messages []
(set! running? true)
(set! queued? false)
(loop [count 0]
(let [m (.pop tasks)]
(when-not (nil? m)
(m)
(when (< count TASK_BATCH_SIZE)
(recur (inc count))))))
(set! running? false)
(when (> (.-length tasks) 0)
(queue-dispatcher)))
(defn queue-dispatcher []
(when-not (and queued? running?)
(set! queued? true)
(goog.async.nextTick process-messages)))
(defn run [f]
(.unbounded-unshift tasks f)
(queue-dispatcher))
(defn queue-delay [f delay]
(js/setTimeout f delay))
@@ -0,0 +1 @@
{:rename-macros {}, :renames {}, :externs {setTimeout {}}, :use-macros {}, :excludes #{}, :name cljs.core.async.impl.dispatch, :imports nil, :requires {buffers cljs.core.async.impl.buffers, cljs.core.async.impl.buffers cljs.core.async.impl.buffers, goog.async.nextTick goog.async.nextTick}, :cljs.spec/speced-vars [], :uses nil, :defs {tasks {:name cljs.core.async.impl.dispatch/tasks, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 5, :column 1, :end-line 5, :end-column 11, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 5, :column 6, :end-line 5, :end-column 11}, :tag any}, running? {:name cljs.core.async.impl.dispatch/running?, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 6, :column 1, :end-line 6, :end-column 14, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 6, :column 6, :end-line 6, :end-column 14}, :tag boolean}, queued? {:name cljs.core.async.impl.dispatch/queued?, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 7, :column 1, :end-line 7, :end-column 13, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 7, :column 6, :end-line 7, :end-column 13}, :tag boolean}, TASK_BATCH_SIZE {:name cljs.core.async.impl.dispatch/TASK_BATCH_SIZE, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 9, :column 1, :end-line 9, :end-column 21, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 9, :column 6, :end-line 9, :end-column 21}, :tag number}, queue-dispatcher {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 26, :column 7, :end-line 26, :end-column 23, :arglists (quote ([]))}, :name cljs.core.async.impl.dispatch/queue-dispatcher, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :end-column 23, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 26, :end-line 26, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, process-messages {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 13, :column 7, :end-line 13, :end-column 23, :arglists (quote ([]))}, :name cljs.core.async.impl.dispatch/process-messages, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :end-column 23, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 13, :end-line 13, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, run {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 31, :column 7, :end-line 31, :end-column 10, :arglists (quote ([f]))}, :name cljs.core.async.impl.dispatch/run, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :end-column 10, :method-params ([f]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 31, :end-line 31, :max-fixed-arity 1, :fn-var true, :arglists (quote ([f]))}, queue-delay {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :line 35, :column 7, :end-line 35, :end-column 18, :arglists (quote ([f delay]))}, :name cljs.core.async.impl.dispatch/queue-delay, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/dispatch.cljs", :end-column 18, :method-params ([f delay]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 35, :end-line 35, :max-fixed-arity 2, :fn-var true, :arglists (quote ([f delay]))}}, :cljs.spec/registry-ref [], :require-macros nil, :doc nil}
@@ -0,0 +1,58 @@
// Compiled by ClojureScript 1.9.946 {}
goog.provide('cljs.core.async.impl.dispatch');
goog.require('cljs.core');
goog.require('cljs.core.async.impl.buffers');
goog.require('goog.async.nextTick');
cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer.call(null,(32));
cljs.core.async.impl.dispatch.running_QMARK_ = false;
cljs.core.async.impl.dispatch.queued_QMARK_ = false;
cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = (1024);
cljs.core.async.impl.dispatch.process_messages = (function cljs$core$async$impl$dispatch$process_messages(){
cljs.core.async.impl.dispatch.running_QMARK_ = true;
cljs.core.async.impl.dispatch.queued_QMARK_ = false;
var count_40840 = (0);
while(true){
var m_40841 = cljs.core.async.impl.dispatch.tasks.pop();
if((m_40841 == null)){
} else {
m_40841.call(null);
if((count_40840 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)){
var G__40842 = (count_40840 + (1));
count_40840 = G__40842;
continue;
} else {
}
}
break;
}
cljs.core.async.impl.dispatch.running_QMARK_ = false;
if((cljs.core.async.impl.dispatch.tasks.length > (0))){
return cljs.core.async.impl.dispatch.queue_dispatcher.call(null);
} else {
return null;
}
});
cljs.core.async.impl.dispatch.queue_dispatcher = (function cljs$core$async$impl$dispatch$queue_dispatcher(){
if((cljs.core.async.impl.dispatch.queued_QMARK_) && (cljs.core.async.impl.dispatch.running_QMARK_)){
return null;
} else {
cljs.core.async.impl.dispatch.queued_QMARK_ = true;
return goog.async.nextTick(cljs.core.async.impl.dispatch.process_messages);
}
});
cljs.core.async.impl.dispatch.run = (function cljs$core$async$impl$dispatch$run(f){
cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f);
return cljs.core.async.impl.dispatch.queue_dispatcher.call(null);
});
cljs.core.async.impl.dispatch.queue_delay = (function cljs$core$async$impl$dispatch$queue_delay(f,delay){
return setTimeout(f,delay);
});
//# sourceMappingURL=dispatch.js.map?rel=1517021944765
@@ -0,0 +1 @@
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/core\/async\/impl\/dispatch.js","sources":["dispatch.cljs?rel=1517021944765"],"lineCount":58,"mappings":";AAAA;;;;AAIA,AAAKA,sCAAM,mDAAA,nDAACC;AACZ,+CAAA,\/CAAKC;AACL,8CAAA,9CAAKC;AAEL,gDAAA,hDAAKC;AAEL,AAAA,AAEA,iDAAA,jDAAMC;AAAN,AACE,+CAAA,\/CAAMH;;AACN,8CAAA,9CAAMC;;AACN,kBAAA,dAAOG;;AAAP,AACE,IAAMC,UAAE,AAAMP;AAAd,AACE,GAAU,YAAA,XAAMO;AAAhB;AAAA,AACE,AAACA;;AACD,GAAM,CAAGD,cAAMF;AAAf,AACE,eAAO,eAAA,dAAKE;;;;AADd;;;;;AAEN,+CAAA,\/CAAMJ;;AACN,GAAM,8CAAA,7CAAG,AAAUF;AAAnB,AACE,OAACQ;;AADH;;;AAGF,iDAAA,jDAAMA;AAAN,AACE,GAAU,CAAKL,iDAAQD;AAAvB;;AAAA,AACE,8CAAA,9CAAMC;;AACN,OAACM,oBAAoBJ;;;AAEzB,oCAAA,pCAAMK,gFAAKC;AAAX,AACE,AAAoBX,sDAAMW;;AAC1B,OAACH;;AAEH,4CAAA,5CAAMI,gGAAaD,EAAEE;AAArB,AACE,OAACC,WAAcH,EAAEE","names":["cljs.core.async.impl.dispatch\/tasks","cljs.core.async.impl.buffers\/ring-buffer","cljs.core.async.impl.dispatch\/running?","cljs.core.async.impl.dispatch\/queued?","cljs.core.async.impl.dispatch\/TASK_BATCH_SIZE","cljs.core.async.impl.dispatch\/process-messages","count","m","cljs.core.async.impl.dispatch\/queue-dispatcher","goog\/async.nextTick","cljs.core.async.impl.dispatch\/run","f","cljs.core.async.impl.dispatch\/queue-delay","delay","js\/setTimeout"]}
@@ -0,0 +1,146 @@
(ns cljs.core.async.impl.ioc-helpers
(:require [cljs.core.async.impl.protocols :as impl])
(:require-macros [cljs.core.async.impl.ioc-macros :as ioc]))
(def ^:const FN-IDX 0)
(def ^:const STATE-IDX 1)
(def ^:const VALUE-IDX 2)
(def ^:const BINDINGS-IDX 3)
(def ^:const EXCEPTION-FRAMES 4)
(def ^:const CURRENT-EXCEPTION 5)
(def ^:const USER-START-IDX 6)
(defn aset-object [arr idx o]
(aget arr idx o))
(defn aget-object [arr idx]
(aget arr idx))
(defn finished?
"Returns true if the machine is in a finished state"
[state-array]
(keyword-identical? (aget state-array STATE-IDX) :finished))
(defn- fn-handler
[f]
(reify
impl/Handler
(active? [_] true)
(blockable? [_] true)
(commit [_] f)))
(defn run-state-machine [state]
((aget-object state FN-IDX) state))
(defn run-state-machine-wrapped [state]
(try
(run-state-machine state)
(catch js/Object ex
(impl/close! ^not-native (aget-object state USER-START-IDX))
(throw ex))))
(defn take! [state blk ^not-native c]
(if-let [cb (impl/take! c (fn-handler
(fn [x]
(ioc/aset-all! state VALUE-IDX x STATE-IDX blk)
(run-state-machine-wrapped state))))]
(do (ioc/aset-all! state VALUE-IDX @cb STATE-IDX blk)
:recur)
nil))
(defn put! [state blk ^not-native c val]
(if-let [cb (impl/put! c val (fn-handler (fn [ret-val]
(ioc/aset-all! state VALUE-IDX ret-val STATE-IDX blk)
(run-state-machine-wrapped state))))]
(do (ioc/aset-all! state VALUE-IDX @cb STATE-IDX blk)
:recur)
nil))
(defn return-chan [state value]
(let [^not-native c (aget state USER-START-IDX)]
(when-not (nil? value)
(impl/put! c value (fn-handler (fn [] nil))))
(impl/close! c)
c))
(defrecord ExceptionFrame [catch-block
^Class catch-exception
finally-block
continue-block
prev])
(defn add-exception-frame [state catch-block catch-exception finally-block continue-block]
(ioc/aset-all! state
EXCEPTION-FRAMES
(->ExceptionFrame catch-block
catch-exception
finally-block
continue-block
(aget-object state EXCEPTION-FRAMES))))
(defn process-exception [state]
(let [exception-frame (aget-object state EXCEPTION-FRAMES)
catch-block (:catch-block exception-frame)
catch-exception (:catch-exception exception-frame)
exception (aget-object state CURRENT-EXCEPTION)]
(cond
(and exception
(not exception-frame))
(throw exception)
(and exception
catch-block
(or (= :default catch-exception)
(instance? catch-exception exception)))
(ioc/aset-all! state
STATE-IDX
catch-block
VALUE-IDX
exception
CURRENT-EXCEPTION
nil
EXCEPTION-FRAMES
(assoc exception-frame
:catch-block nil
:catch-exception nil))
(and exception
(not catch-block)
(not (:finally-block exception-frame)))
(do (ioc/aset-all! state
EXCEPTION-FRAMES
(:prev exception-frame))
(recur state))
(and exception
(not catch-block)
(:finally-block exception-frame))
(ioc/aset-all! state
STATE-IDX
(:finally-block exception-frame)
EXCEPTION-FRAMES
(assoc exception-frame
:finally-block nil))
(and (not exception)
(:finally-block exception-frame))
(do (ioc/aset-all! state
STATE-IDX
(:finally-block exception-frame)
EXCEPTION-FRAMES
(assoc exception-frame
:finally-block nil)))
(and (not exception)
(not (:finally-block exception-frame)))
(do (ioc/aset-all! state
STATE-IDX
(:continue-block exception-frame)
EXCEPTION-FRAMES
(:prev exception-frame)))
:else (throw (js/Error. "No matching clause")))))
@@ -0,0 +1 @@
{:rename-macros {}, :renames {}, :externs {Object {}, Error {}}, :use-macros {}, :excludes #{}, :name cljs.core.async.impl.ioc-helpers, :imports nil, :requires {impl cljs.core.async.impl.protocols, cljs.core.async.impl.protocols cljs.core.async.impl.protocols}, :cljs.spec/speced-vars [], :uses nil, :defs {EXCEPTION-FRAMES {:meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :line 9, :column 14, :end-line 9, :end-column 30, :const true}, :name cljs.core.async.impl.ioc-helpers/EXCEPTION-FRAMES, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :end-column 30, :const-expr {:op :constant, :env {:context :expr}, :form 4, :tag number}, :column 1, :const true, :line 9, :end-line 9, :tag number}, process-exception {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :line 83, :column 7, :end-line 83, :end-column 24, :arglists (quote ([state]))}, :name cljs.core.async.impl.ioc-helpers/process-exception, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :end-column 24, :method-params ([state]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 83, :end-line 83, :max-fixed-arity 1, :fn-var true, :arglists (quote ([state]))}, ExceptionFrame {:num-fields 5, :protocols #{cljs.core/IRecord cljs.core/IEquiv cljs.core/IHash cljs.core/ICollection cljs.core/ICounted cljs.core/ISeqable cljs.core/IMeta cljs.core/ICloneable cljs.core/IPrintWithWriter cljs.core/IIterable cljs.core/IWithMeta cljs.core/IAssociative cljs.core/IMap cljs.core/ILookup}, :name cljs.core.async.impl.ioc-helpers/ExceptionFrame, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :end-column 26, :type true, :column 12, :internal-ctor true, :line 68, :record true, :end-line 68, :skip-protocol-flag #{cljs.core/IRecord cljs.core/IEquiv cljs.core/IHash cljs.core/ICollection cljs.core/ICounted cljs.core/ISeqable cljs.core/IMeta cljs.core/ICloneable cljs.core/IPrintWithWriter cljs.core/IIterable cljs.core/IWithMeta cljs.core/IAssociative cljs.core/IMap cljs.core/ILookup}}, STATE-IDX {:meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :line 6, :column 14, :end-line 6, :end-column 23, :const true}, :name cljs.core.async.impl.ioc-helpers/STATE-IDX, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :end-column 23, :const-expr {:op :constant, :env {:context :expr}, :form 1, :tag number}, :column 1, :const true, :line 6, :end-line 6, :tag number}, map->ExceptionFrame {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :line 68, :column 12, :end-line 68, :end-column 26, :internal-ctor true, :factory :map, :arglists (quote ([G__42190]))}, :name cljs.core.async.impl.ioc-helpers/map->ExceptionFrame, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :end-column 26, :method-params ([G__42190]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :internal-ctor true, :factory :map, :line 68, :end-line 68, :max-fixed-arity 1, :fn-var true, :arglists (quote ([G__42190]))}, aset-object {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :line 13, :column 7, :end-line 13, :end-column 18, :arglists (quote ([arr idx o]))}, :name cljs.core.async.impl.ioc-helpers/aset-object, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :end-column 18, :method-params ([arr idx o]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 13, :end-line 13, :max-fixed-arity 3, :fn-var true, :arglists (quote ([arr idx o]))}, ->t_cljs$core$async$impl$ioc_helpers42174 {:protocol-inline nil, :meta {:anonymous true, :protocols #{cljs.core.async.impl.protocols/Handler cljs.core/IMeta cljs.core/IWithMeta}, :skip-protocol-flag #{cljs.core/IMeta cljs.core/IWithMeta}, :factory :positional, :arglists (quote ([f meta42175])), :file nil}, :protocols #{cljs.core.async.impl.protocols/Handler cljs.core/IMeta cljs.core/IWithMeta}, :name cljs.core.async.impl.ioc-helpers/->t_cljs$core$async$impl$ioc_helpers42174, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :method-params ([f meta42175]), :protocol-impl nil, :arglists-meta (nil nil), :anonymous true, :column 3, :factory :positional, :line 27, :max-fixed-arity 2, :fn-var true, :arglists (quote ([f meta42175])), :skip-protocol-flag #{cljs.core/IMeta cljs.core/IWithMeta}}, add-exception-frame {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/ioc_helpers.cljs", :line 74, :column 7, :end-line 74, :end-column 26, :arglists (quoteLine truncated
@@ -0,0 +1,489 @@
// Compiled by ClojureScript 1.9.946 {}
goog.provide('cljs.core.async.impl.ioc_helpers');
goog.require('cljs.core');
goog.require('cljs.core.async.impl.protocols');
cljs.core.async.impl.ioc_helpers.FN_IDX = (0);
cljs.core.async.impl.ioc_helpers.STATE_IDX = (1);
cljs.core.async.impl.ioc_helpers.VALUE_IDX = (2);
cljs.core.async.impl.ioc_helpers.BINDINGS_IDX = (3);
cljs.core.async.impl.ioc_helpers.EXCEPTION_FRAMES = (4);
cljs.core.async.impl.ioc_helpers.CURRENT_EXCEPTION = (5);
cljs.core.async.impl.ioc_helpers.USER_START_IDX = (6);
cljs.core.async.impl.ioc_helpers.aset_object = (function cljs$core$async$impl$ioc_helpers$aset_object(arr,idx,o){
return (arr[idx][o]);
});
cljs.core.async.impl.ioc_helpers.aget_object = (function cljs$core$async$impl$ioc_helpers$aget_object(arr,idx){
return (arr[idx]);
});
/**
* Returns true if the machine is in a finished state
*/
cljs.core.async.impl.ioc_helpers.finished_QMARK_ = (function cljs$core$async$impl$ioc_helpers$finished_QMARK_(state_array){
return cljs.core.keyword_identical_QMARK_.call(null,(state_array[(1)]),new cljs.core.Keyword(null,"finished","finished",-1018867731));
});
cljs.core.async.impl.ioc_helpers.fn_handler = (function cljs$core$async$impl$ioc_helpers$fn_handler(f){
if(typeof cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174 !== 'undefined'){
} else {
/**
* @constructor
* @implements {cljs.core.async.impl.protocols.Handler}
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
*/
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174 = (function (f,meta42175){
this.f = f;
this.meta42175 = meta42175;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_42176,meta42175__$1){
var self__ = this;
var _42176__$1 = this;
return (new cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174(self__.f,meta42175__$1));
});
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_42176){
var self__ = this;
var _42176__$1 = this;
return self__.meta42175;
});
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.prototype.cljs$core$async$impl$protocols$Handler$ = cljs.core.PROTOCOL_SENTINEL;
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.prototype.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
});
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.prototype.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
});
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.prototype.cljs$core$async$impl$protocols$Handler$commit$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.f;
});
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),new cljs.core.Symbol(null,"meta42175","meta42175",1647365147,null)], null);
});
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.cljs$lang$type = true;
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.cljs$lang$ctorStr = "cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers42174";
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers42174");
});
cljs.core.async.impl.ioc_helpers.__GT_t_cljs$core$async$impl$ioc_helpers42174 = (function cljs$core$async$impl$ioc_helpers$fn_handler_$___GT_t_cljs$core$async$impl$ioc_helpers42174(f__$1,meta42175){
return (new cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174(f__$1,meta42175));
});
}
return (new cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers42174(f,cljs.core.PersistentArrayMap.EMPTY));
});
cljs.core.async.impl.ioc_helpers.run_state_machine = (function cljs$core$async$impl$ioc_helpers$run_state_machine(state){
return cljs.core.async.impl.ioc_helpers.aget_object.call(null,state,(0)).call(null,state);
});
cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped = (function cljs$core$async$impl$ioc_helpers$run_state_machine_wrapped(state){
try{return cljs.core.async.impl.ioc_helpers.run_state_machine.call(null,state);
}catch (e42177){if((e42177 instanceof Object)){
var ex = e42177;
cljs.core.async.impl.protocols.close_BANG_.call(null,cljs.core.async.impl.ioc_helpers.aget_object.call(null,state,(6)));
throw ex;
} else {
throw e42177;
}
}});
cljs.core.async.impl.ioc_helpers.take_BANG_ = (function cljs$core$async$impl$ioc_helpers$take_BANG_(state,blk,c){
var temp__5455__auto__ = cljs.core.async.impl.protocols.take_BANG_.call(null,c,cljs.core.async.impl.ioc_helpers.fn_handler.call(null,(function (x){
var statearr_42178_42180 = state;
(statearr_42178_42180[(2)] = x);
(statearr_42178_42180[(1)] = blk);
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state);
})));
if(cljs.core.truth_(temp__5455__auto__)){
var cb = temp__5455__auto__;
var statearr_42179_42181 = state;
(statearr_42179_42181[(2)] = cljs.core.deref.call(null,cb));
(statearr_42179_42181[(1)] = blk);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
});
cljs.core.async.impl.ioc_helpers.put_BANG_ = (function cljs$core$async$impl$ioc_helpers$put_BANG_(state,blk,c,val){
var temp__5455__auto__ = cljs.core.async.impl.protocols.put_BANG_.call(null,c,val,cljs.core.async.impl.ioc_helpers.fn_handler.call(null,(function (ret_val){
var statearr_42182_42184 = state;
(statearr_42182_42184[(2)] = ret_val);
(statearr_42182_42184[(1)] = blk);
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state);
})));
if(cljs.core.truth_(temp__5455__auto__)){
var cb = temp__5455__auto__;
var statearr_42183_42185 = state;
(statearr_42183_42185[(2)] = cljs.core.deref.call(null,cb));
(statearr_42183_42185[(1)] = blk);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
});
cljs.core.async.impl.ioc_helpers.return_chan = (function cljs$core$async$impl$ioc_helpers$return_chan(state,value){
var c = (state[(6)]);
if((value == null)){
} else {
cljs.core.async.impl.protocols.put_BANG_.call(null,c,value,cljs.core.async.impl.ioc_helpers.fn_handler.call(null,((function (c){
return (function (){
return null;
});})(c))
));
}
cljs.core.async.impl.protocols.close_BANG_.call(null,c);
return c;
});
/**
* @constructor
* @implements {cljs.core.IRecord}
* @implements {cljs.core.IEquiv}
* @implements {cljs.core.IHash}
* @implements {cljs.core.ICollection}
* @implements {cljs.core.ICounted}
* @implements {cljs.core.ISeqable}
* @implements {cljs.core.IMeta}
* @implements {cljs.core.ICloneable}
* @implements {cljs.core.IPrintWithWriter}
* @implements {cljs.core.IIterable}
* @implements {cljs.core.IWithMeta}
* @implements {cljs.core.IAssociative}
* @implements {cljs.core.IMap}
* @implements {cljs.core.ILookup}
*/
cljs.core.async.impl.ioc_helpers.ExceptionFrame = (function (catch_block,catch_exception,finally_block,continue_block,prev,__meta,__extmap,__hash){
this.catch_block = catch_block;
this.catch_exception = catch_exception;
this.finally_block = finally_block;
this.continue_block = continue_block;
this.prev = prev;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__36186__auto__,k__36187__auto__){
var self__ = this;
var this__36186__auto____$1 = this;
return this__36186__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__36187__auto__,null);
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__36188__auto__,k42187,else__36189__auto__){
var self__ = this;
var this__36188__auto____$1 = this;
var G__42191 = k42187;
var G__42191__$1 = (((G__42191 instanceof cljs.core.Keyword))?G__42191.fqn:null);
switch (G__42191__$1) {
case "catch-block":
return self__.catch_block;
break;
case "catch-exception":
return self__.catch_exception;
break;
case "finally-block":
return self__.finally_block;
break;
case "continue-block":
return self__.continue_block;
break;
case "prev":
return self__.prev;
break;
default:
return cljs.core.get.call(null,self__.__extmap,k42187,else__36189__auto__);
}
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__36200__auto__,writer__36201__auto__,opts__36202__auto__){
var self__ = this;
var this__36200__auto____$1 = this;
var pr_pair__36203__auto__ = ((function (this__36200__auto____$1){
return (function (keyval__36204__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__36201__auto__,cljs.core.pr_writer,""," ","",opts__36202__auto__,keyval__36204__auto__);
});})(this__36200__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__36201__auto__,pr_pair__36203__auto__,"#cljs.core.async.impl.ioc-helpers.ExceptionFrame{",", ","}",opts__36202__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"catch-block","catch-block",1175212748),self__.catch_block],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795),self__.catch_exception],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"finally-block","finally-block",832982472),self__.finally_block],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850),self__.continue_block],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"prev","prev",-1597069226),self__.prev],null))], null),self__.__extmap));
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__42186){
var self__ = this;
var G__42186__$1 = this;
return (new cljs.core.RecordIter((0),G__42186__$1,5,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"catch-block","catch-block",1175212748),new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795),new cljs.core.Keyword(null,"finally-block","finally-block",832982472),new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850),new cljs.core.Keyword(null,"prev","prev",-1597069226)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__36184__auto__){
var self__ = this;
var this__36184__auto____$1 = this;
return self__.__meta;
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__36181__auto__){
var self__ = this;
var this__36181__auto____$1 = this;
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,self__.catch_exception,self__.finally_block,self__.continue_block,self__.prev,self__.__meta,self__.__extmap,self__.__hash));
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__36190__auto__){
var self__ = this;
var this__36190__auto____$1 = this;
return (5 + cljs.core.count.call(null,self__.__extmap));
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__36182__auto__){
var self__ = this;
var this__36182__auto____$1 = this;
var h__35954__auto__ = self__.__hash;
if(!((h__35954__auto__ == null))){
return h__35954__auto__;
} else {
var h__35954__auto____$1 = ((function (h__35954__auto__,this__36182__auto____$1){
return (function (coll__36183__auto__){
return (846900531 ^ cljs.core.hash_unordered_coll.call(null,coll__36183__auto__));
});})(h__35954__auto__,this__36182__auto____$1))
.call(null,this__36182__auto____$1);
self__.__hash = h__35954__auto____$1;
return h__35954__auto____$1;
}
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this42188,other42189){
var self__ = this;
var this42188__$1 = this;
return (!((other42189 == null))) && ((this42188__$1.constructor === other42189.constructor)) && (cljs.core._EQ_.call(null,this42188__$1.catch_block,other42189.catch_block)) && (cljs.core._EQ_.call(null,this42188__$1.catch_exception,other42189.catch_exception)) && (cljs.core._EQ_.call(null,this42188__$1.finally_block,other42189.finally_block)) && (cljs.core._EQ_.call(null,this42188__$1.continue_block,other42189.continue_block)) && (cljs.core._EQ_.call(null,this42188__$1.prev,other42189.prev)) && (cljs.core._EQ_.call(null,this42188__$1.__extmap,other42189.__extmap));
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__36195__auto__,k__36196__auto__){
var self__ = this;
var this__36195__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"finally-block","finally-block",832982472),null,new cljs.core.Keyword(null,"catch-block","catch-block",1175212748),null,new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795),null,new cljs.core.Keyword(null,"prev","prev",-1597069226),null,new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850),null], null), null),k__36196__auto__)){
return cljs.core.dissoc.call(null,cljs.core._with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__36195__auto____$1),self__.__meta),k__36196__auto__);
} else {
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,self__.catch_exception,self__.finally_block,self__.continue_block,self__.prev,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__36196__auto__)),null));
}
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__36193__auto__,k__36194__auto__,G__42186){
var self__ = this;
var this__36193__auto____$1 = this;
var pred__42192 = cljs.core.keyword_identical_QMARK_;
var expr__42193 = k__36194__auto__;
if(cljs.core.truth_(pred__42192.call(null,new cljs.core.Keyword(null,"catch-block","catch-block",1175212748),expr__42193))){
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(G__42186,self__.catch_exception,self__.finally_block,self__.continue_block,self__.prev,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__42192.call(null,new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795),expr__42193))){
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,G__42186,self__.finally_block,self__.continue_block,self__.prev,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__42192.call(null,new cljs.core.Keyword(null,"finally-block","finally-block",832982472),expr__42193))){
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,self__.catch_exception,G__42186,self__.continue_block,self__.prev,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__42192.call(null,new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850),expr__42193))){
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,self__.catch_exception,self__.finally_block,G__42186,self__.prev,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__42192.call(null,new cljs.core.Keyword(null,"prev","prev",-1597069226),expr__42193))){
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,self__.catch_exception,self__.finally_block,self__.continue_block,G__42186,self__.__meta,self__.__extmap,null));
} else {
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,self__.catch_exception,self__.finally_block,self__.continue_block,self__.prev,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__36194__auto__,G__42186),null));
}
}
}
}
}
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__36198__auto__){
var self__ = this;
var this__36198__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"catch-block","catch-block",1175212748),self__.catch_block],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795),self__.catch_exception],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"finally-block","finally-block",832982472),self__.finally_block],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850),self__.continue_block],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"prev","prev",-1597069226),self__.prev],null))], null),self__.__extmap));
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__36185__auto__,G__42186){
var self__ = this;
var this__36185__auto____$1 = this;
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(self__.catch_block,self__.catch_exception,self__.finally_block,self__.continue_block,self__.prev,G__42186,self__.__extmap,self__.__hash));
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__36191__auto__,entry__36192__auto__){
var self__ = this;
var this__36191__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__36192__auto__)){
return this__36191__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth.call(null,entry__36192__auto__,(0)),cljs.core._nth.call(null,entry__36192__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__36191__auto____$1,entry__36192__auto__);
}
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.getBasis = (function (){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"catch-block","catch-block",-1479223021,null),cljs.core.with_meta(new cljs.core.Symbol(null,"catch-exception","catch-exception",-356775268,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol(null,"Class","Class",2064526977,null)], null)),new cljs.core.Symbol(null,"finally-block","finally-block",-1821453297,null),new cljs.core.Symbol(null,"continue-block","continue-block",-211516323,null),new cljs.core.Symbol(null,"prev","prev",43462301,null)], null);
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.cljs$lang$type = true;
cljs.core.async.impl.ioc_helpers.ExceptionFrame.cljs$lang$ctorPrSeq = (function (this__36224__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"cljs.core.async.impl.ioc-helpers/ExceptionFrame");
});
cljs.core.async.impl.ioc_helpers.ExceptionFrame.cljs$lang$ctorPrWriter = (function (this__36224__auto__,writer__36225__auto__){
return cljs.core._write.call(null,writer__36225__auto__,"cljs.core.async.impl.ioc-helpers/ExceptionFrame");
});
cljs.core.async.impl.ioc_helpers.__GT_ExceptionFrame = (function cljs$core$async$impl$ioc_helpers$__GT_ExceptionFrame(catch_block,catch_exception,finally_block,continue_block,prev){
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(catch_block,catch_exception,finally_block,continue_block,prev,null,null,null));
});
cljs.core.async.impl.ioc_helpers.map__GT_ExceptionFrame = (function cljs$core$async$impl$ioc_helpers$map__GT_ExceptionFrame(G__42190){
return (new cljs.core.async.impl.ioc_helpers.ExceptionFrame(new cljs.core.Keyword(null,"catch-block","catch-block",1175212748).cljs$core$IFn$_invoke$arity$1(G__42190),new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795).cljs$core$IFn$_invoke$arity$1(G__42190),new cljs.core.Keyword(null,"finally-block","finally-block",832982472).cljs$core$IFn$_invoke$arity$1(G__42190),new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850).cljs$core$IFn$_invoke$arity$1(G__42190),new cljs.core.Keyword(null,"prev","prev",-1597069226).cljs$core$IFn$_invoke$arity$1(G__42190),null,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,G__42190,new cljs.core.Keyword(null,"catch-block","catch-block",1175212748),new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795),new cljs.core.Keyword(null,"finally-block","finally-block",832982472),new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850),new cljs.core.Keyword(null,"prev","prev",-1597069226))),null));
});
cljs.core.async.impl.ioc_helpers.add_exception_frame = (function cljs$core$async$impl$ioc_helpers$add_exception_frame(state,catch_block,catch_exception,finally_block,continue_block){
var statearr_42196 = state;
(statearr_42196[(4)] = cljs.core.async.impl.ioc_helpers.__GT_ExceptionFrame.call(null,catch_block,catch_exception,finally_block,continue_block,cljs.core.async.impl.ioc_helpers.aget_object.call(null,state,(4))));
return statearr_42196;
});
cljs.core.async.impl.ioc_helpers.process_exception = (function cljs$core$async$impl$ioc_helpers$process_exception(state){
while(true){
var exception_frame = cljs.core.async.impl.ioc_helpers.aget_object.call(null,state,(4));
var catch_block = new cljs.core.Keyword(null,"catch-block","catch-block",1175212748).cljs$core$IFn$_invoke$arity$1(exception_frame);
var catch_exception = new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795).cljs$core$IFn$_invoke$arity$1(exception_frame);
var exception = cljs.core.async.impl.ioc_helpers.aget_object.call(null,state,(5));
if(cljs.core.truth_((function (){var and__35486__auto__ = exception;
if(cljs.core.truth_(and__35486__auto__)){
return cljs.core.not.call(null,exception_frame);
} else {
return and__35486__auto__;
}
})())){
throw exception;
} else {
if(cljs.core.truth_((function (){var and__35486__auto__ = exception;
if(cljs.core.truth_(and__35486__auto__)){
var and__35486__auto____$1 = catch_block;
if(cljs.core.truth_(and__35486__auto____$1)){
return (cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"default","default",-1987822328),catch_exception)) || ((exception instanceof catch_exception));
} else {
return and__35486__auto____$1;
}
} else {
return and__35486__auto__;
}
})())){
var statearr_42197 = state;
(statearr_42197[(1)] = catch_block);
(statearr_42197[(2)] = exception);
(statearr_42197[(5)] = null);
(statearr_42197[(4)] = cljs.core.assoc.call(null,exception_frame,new cljs.core.Keyword(null,"catch-block","catch-block",1175212748),null,new cljs.core.Keyword(null,"catch-exception","catch-exception",-1997306795),null));
return statearr_42197;
} else {
if(cljs.core.truth_((function (){var and__35486__auto__ = exception;
if(cljs.core.truth_(and__35486__auto__)){
return (cljs.core.not.call(null,catch_block)) && (cljs.core.not.call(null,new cljs.core.Keyword(null,"finally-block","finally-block",832982472).cljs$core$IFn$_invoke$arity$1(exception_frame)));
} else {
return and__35486__auto__;
}
})())){
var statearr_42198_42202 = state;
(statearr_42198_42202[(4)] = new cljs.core.Keyword(null,"prev","prev",-1597069226).cljs$core$IFn$_invoke$arity$1(exception_frame));
var G__42203 = state;
state = G__42203;
continue;
} else {
if(cljs.core.truth_((function (){var and__35486__auto__ = exception;
if(cljs.core.truth_(and__35486__auto__)){
var and__35486__auto____$1 = cljs.core.not.call(null,catch_block);
if(and__35486__auto____$1){
return new cljs.core.Keyword(null,"finally-block","finally-block",832982472).cljs$core$IFn$_invoke$arity$1(exception_frame);
} else {
return and__35486__auto____$1;
}
} else {
return and__35486__auto__;
}
})())){
var statearr_42199 = state;
(statearr_42199[(1)] = new cljs.core.Keyword(null,"finally-block","finally-block",832982472).cljs$core$IFn$_invoke$arity$1(exception_frame));
(statearr_42199[(4)] = cljs.core.assoc.call(null,exception_frame,new cljs.core.Keyword(null,"finally-block","finally-block",832982472),null));
return statearr_42199;
} else {
if(cljs.core.truth_((function (){var and__35486__auto__ = cljs.core.not.call(null,exception);
if(and__35486__auto__){
return new cljs.core.Keyword(null,"finally-block","finally-block",832982472).cljs$core$IFn$_invoke$arity$1(exception_frame);
} else {
return and__35486__auto__;
}
})())){
var statearr_42200 = state;
(statearr_42200[(1)] = new cljs.core.Keyword(null,"finally-block","finally-block",832982472).cljs$core$IFn$_invoke$arity$1(exception_frame));
(statearr_42200[(4)] = cljs.core.assoc.call(null,exception_frame,new cljs.core.Keyword(null,"finally-block","finally-block",832982472),null));
return statearr_42200;
} else {
if((cljs.core.not.call(null,exception)) && (cljs.core.not.call(null,new cljs.core.Keyword(null,"finally-block","finally-block",832982472).cljs$core$IFn$_invoke$arity$1(exception_frame)))){
var statearr_42201 = state;
(statearr_42201[(1)] = new cljs.core.Keyword(null,"continue-block","continue-block",-1852047850).cljs$core$IFn$_invoke$arity$1(exception_frame));
(statearr_42201[(4)] = new cljs.core.Keyword(null,"prev","prev",-1597069226).cljs$core$IFn$_invoke$arity$1(exception_frame));
return statearr_42201;
} else {
throw (new Error("No matching clause"));
}
}
}
}
}
}
break;
}
});
//# sourceMappingURL=ioc_helpers.js.map?rel=1517021945188
@@ -0,0 +1 @@
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/core\/async\/impl\/ioc_helpers.js","sources":["ioc_helpers.cljs?rel=1517021945190"],"lineCount":489,"mappings":";AAAA;;;AAIA,0CAAA,1CAAaA;AACb,6CAAA,7CAAaC;AACb,6CAAA,7CAAaC;AACb,gDAAA,hDAAaC;AACb,oDAAA,pDAAaC;AACb,qDAAA,rDAAaC;AACb,kDAAA,lDAAaC;AAEb,+CAAA,\/CAAMC,sGAAaC,IAAIC,IAAIC;AAA3B,AACE,QAAMF,IAAIC,KAAIC;;AAEhB,+CAAA,\/CAAMC,sGAAaH,IAAIC;AAAvB,AACE,QAAMD,IAAIC;;AAGZ;;;mDAAA,nDAAMG,8GAEHC;AAFH,AAGE,uEAAA,hEAACC,6CAAmB,CAAMD,YAAYZ,AAAA;;AAExC,8CAAA,9CAAOc,oGACJC;AADH,AAEE,AAAA,GAAA,OAAAC;AAAA;AAAA,AAAA,AAAA;;;;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,AAAAA,4HAAA,WAAAC,OAAAC;;AAAA,AAAA,IAAAD,aAAA;qFADCF,rFACD,AAAA,YAAAC,kFAAAE;;;AAAA,AAAA,AAAA,AAAAF,mHAAA,WAAAC;;AAAA,AAAA,IAAAA,aAAA;AAAA,A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,0BAAA;AAAA,AAAA,IAAAE,cAAAvF;IAAAwF,cAAAF;AAAA,AAAA,oBAAA,AAAAC,sBAAA,mEAAACLine truncated
@@ -0,0 +1,43 @@
;; Copyright (c) Rich Hickey and contributors. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns cljs.core.async.impl.protocols)
(def ^:const MAX-QUEUE-SIZE 1024)
(defprotocol ReadPort
(take! [port fn1-handler] "derefable val if taken, nil if take was enqueued"))
(defprotocol WritePort
(put! [port val fn1-handler] "derefable boolean (false if already closed) if handled, nil if put was enqueued.
Must throw on nil val."))
(defprotocol Channel
(close! [chan])
(closed? [chan]))
(defprotocol Handler
(active? [h] "returns true if has callback. Must work w/o lock")
(blockable? [h] "returns true if this handler may be blocked, otherwise it must not block")
#_(lock-id [h] "a unique id for lock acquisition order, 0 if no lock")
(commit [h] "commit to fulfilling its end of the transfer, returns cb. Must be called within lock"))
(defprotocol Buffer
(full? [b] "returns true if buffer cannot accept put")
(remove! [b] "remove and return next item from buffer, called under chan mutex")
(add!* [b itm] "if room, add item to the buffer, returns b, called under chan mutex")
(close-buf! [b] "called on chan closed under chan mutex, return ignored"))
(defn add!
([b] b)
([b itm]
(assert (not (nil? itm)))
(add!* b itm)))
;; Defines a buffer that will never block (return true to full?)
(defprotocol UnblockingBuffer)
@@ -0,0 +1 @@
{:rename-macros {}, :renames {}, :externs {Error {}}, :use-macros {}, :excludes #{}, :name cljs.core.async.impl.protocols, :imports nil, :requires nil, :cljs.spec/speced-vars [], :uses nil, :defs {remove! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :line 32, :column 4, :end-line 32, :end-column 11, :protocol cljs.core.async.impl.protocols/Buffer, :doc "remove and return next item from buffer, called under chan mutex", :arglists (quote ([b]))}, :protocol cljs.core.async.impl.protocols/Buffer, :name cljs.core.async.impl.protocols/remove!, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :end-column 11, :method-params ([b]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 30, :end-line 32, :max-fixed-arity 1, :fn-var true, :arglists (quote ([b])), :doc "remove and return next item from buffer, called under chan mutex"}, close-buf! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :line 34, :column 4, :end-line 34, :end-column 14, :protocol cljs.core.async.impl.protocols/Buffer, :doc "called on chan closed under chan mutex, return ignored", :arglists (quote ([b]))}, :protocol cljs.core.async.impl.protocols/Buffer, :name cljs.core.async.impl.protocols/close-buf!, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :end-column 14, :method-params ([b]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 30, :end-line 34, :max-fixed-arity 1, :fn-var true, :arglists (quote ([b])), :doc "called on chan closed under chan mutex, return ignored"}, close! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :line 21, :column 4, :end-line 21, :end-column 10, :protocol cljs.core.async.impl.protocols/Channel, :doc nil, :arglists (quote ([chan]))}, :protocol cljs.core.async.impl.protocols/Channel, :name cljs.core.async.impl.protocols/close!, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :end-column 10, :method-params ([chan]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 20, :end-line 21, :max-fixed-arity 1, :fn-var true, :arglists (quote ([chan])), :doc nil}, Handler {:meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :line 24, :column 14, :end-line 24, :end-column 21, :doc nil, :protocol-symbol true, :jsdoc ("@interface"), :protocol-info {:methods {active? [[h]], blockable? [[h]], commit [[h]]}}}, :protocol-symbol true, :name cljs.core.async.impl.protocols/Handler, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :end-column 21, :column 1, :line 24, :protocol-info {:methods {active? [[h]], blockable? [[h]], commit [[h]]}}, :info nil, :end-line 24, :tag any, :impls #{}, :doc nil, :jsdoc ("@interface")}, blockable? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :line 26, :column 4, :end-line 26, :end-column 14, :protocol cljs.core.async.impl.protocols/Handler, :doc "returns true if this handler may be blocked, otherwise it must not block", :arglists (quote ([h]))}, :protocol cljs.core.async.impl.protocols/Handler, :name cljs.core.async.impl.protocols/blockable?, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :end-column 14, :method-params ([h]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 24, :end-line 26, :max-fixed-arity 1, :fn-var true, :arglists (quote ([h])), :doc "returns true if this handler may be blocked, otherwise it must not block"}, active? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :line 25, :column 4, :end-line 25, :end-column 11, :protocol cljs.core.async.impl.protocols/Handler, :doc "returns true if has callback. Must work w/o lock", :arglists (quote ([h]))}, :protocol cljs.core.async.impl.protocols/Handler, :name cljs.core.async.impl.protocols/active?, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :end-column 11, :method-params ([h]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 24, :end-line 25, :max-fixed-arity 1, :fn-var true, :arglists (quote ([h])), :doc "returns true if has callback. Must work w/o lock"}, Buffer {:meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/protocols.cljs", :line 30, :column 14, :end-line 30, :end-column 20, :doc nil, :protocol-symbol true, :jsdoc ("@interface"), :protocol-info {:methods {full? [[b]], remove! [[b]], add!* [[b itm]], close-buf! [[b]]}}}, :protocol-symbol true, :name cljs.core.async.Line truncated
@@ -0,0 +1,311 @@
// Compiled by ClojureScript 1.9.946 {}
goog.provide('cljs.core.async.impl.protocols');
goog.require('cljs.core');
cljs.core.async.impl.protocols.MAX_QUEUE_SIZE = (1024);
/**
* @interface
*/
cljs.core.async.impl.protocols.ReadPort = function(){};
/**
* derefable val if taken, nil if take was enqueued
*/
cljs.core.async.impl.protocols.take_BANG_ = (function cljs$core$async$impl$protocols$take_BANG_(port,fn1_handler){
if((!((port == null))) && (!((port.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2 == null)))){
return port.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2(port,fn1_handler);
} else {
var x__36231__auto__ = (((port == null))?null:port);
var m__36232__auto__ = (cljs.core.async.impl.protocols.take_BANG_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,port,fn1_handler);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.take_BANG_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,port,fn1_handler);
} else {
throw cljs.core.missing_protocol.call(null,"ReadPort.take!",port);
}
}
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.WritePort = function(){};
/**
* derefable boolean (false if already closed) if handled, nil if put was enqueued.
* Must throw on nil val.
*/
cljs.core.async.impl.protocols.put_BANG_ = (function cljs$core$async$impl$protocols$put_BANG_(port,val,fn1_handler){
if((!((port == null))) && (!((port.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 == null)))){
return port.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3(port,val,fn1_handler);
} else {
var x__36231__auto__ = (((port == null))?null:port);
var m__36232__auto__ = (cljs.core.async.impl.protocols.put_BANG_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,port,val,fn1_handler);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.put_BANG_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,port,val,fn1_handler);
} else {
throw cljs.core.missing_protocol.call(null,"WritePort.put!",port);
}
}
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.Channel = function(){};
cljs.core.async.impl.protocols.close_BANG_ = (function cljs$core$async$impl$protocols$close_BANG_(chan){
if((!((chan == null))) && (!((chan.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1 == null)))){
return chan.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1(chan);
} else {
var x__36231__auto__ = (((chan == null))?null:chan);
var m__36232__auto__ = (cljs.core.async.impl.protocols.close_BANG_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,chan);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.close_BANG_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,chan);
} else {
throw cljs.core.missing_protocol.call(null,"Channel.close!",chan);
}
}
}
});
cljs.core.async.impl.protocols.closed_QMARK_ = (function cljs$core$async$impl$protocols$closed_QMARK_(chan){
if((!((chan == null))) && (!((chan.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1 == null)))){
return chan.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1(chan);
} else {
var x__36231__auto__ = (((chan == null))?null:chan);
var m__36232__auto__ = (cljs.core.async.impl.protocols.closed_QMARK_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,chan);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.closed_QMARK_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,chan);
} else {
throw cljs.core.missing_protocol.call(null,"Channel.closed?",chan);
}
}
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.Handler = function(){};
/**
* returns true if has callback. Must work w/o lock
*/
cljs.core.async.impl.protocols.active_QMARK_ = (function cljs$core$async$impl$protocols$active_QMARK_(h){
if((!((h == null))) && (!((h.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 == null)))){
return h.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(h);
} else {
var x__36231__auto__ = (((h == null))?null:h);
var m__36232__auto__ = (cljs.core.async.impl.protocols.active_QMARK_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,h);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.active_QMARK_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,h);
} else {
throw cljs.core.missing_protocol.call(null,"Handler.active?",h);
}
}
}
});
/**
* returns true if this handler may be blocked, otherwise it must not block
*/
cljs.core.async.impl.protocols.blockable_QMARK_ = (function cljs$core$async$impl$protocols$blockable_QMARK_(h){
if((!((h == null))) && (!((h.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 == null)))){
return h.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1(h);
} else {
var x__36231__auto__ = (((h == null))?null:h);
var m__36232__auto__ = (cljs.core.async.impl.protocols.blockable_QMARK_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,h);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.blockable_QMARK_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,h);
} else {
throw cljs.core.missing_protocol.call(null,"Handler.blockable?",h);
}
}
}
});
/**
* commit to fulfilling its end of the transfer, returns cb. Must be called within lock
*/
cljs.core.async.impl.protocols.commit = (function cljs$core$async$impl$protocols$commit(h){
if((!((h == null))) && (!((h.cljs$core$async$impl$protocols$Handler$commit$arity$1 == null)))){
return h.cljs$core$async$impl$protocols$Handler$commit$arity$1(h);
} else {
var x__36231__auto__ = (((h == null))?null:h);
var m__36232__auto__ = (cljs.core.async.impl.protocols.commit[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,h);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.commit["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,h);
} else {
throw cljs.core.missing_protocol.call(null,"Handler.commit",h);
}
}
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.Buffer = function(){};
/**
* returns true if buffer cannot accept put
*/
cljs.core.async.impl.protocols.full_QMARK_ = (function cljs$core$async$impl$protocols$full_QMARK_(b){
if((!((b == null))) && (!((b.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 == null)))){
return b.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1(b);
} else {
var x__36231__auto__ = (((b == null))?null:b);
var m__36232__auto__ = (cljs.core.async.impl.protocols.full_QMARK_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,b);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.full_QMARK_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,b);
} else {
throw cljs.core.missing_protocol.call(null,"Buffer.full?",b);
}
}
}
});
/**
* remove and return next item from buffer, called under chan mutex
*/
cljs.core.async.impl.protocols.remove_BANG_ = (function cljs$core$async$impl$protocols$remove_BANG_(b){
if((!((b == null))) && (!((b.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 == null)))){
return b.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1(b);
} else {
var x__36231__auto__ = (((b == null))?null:b);
var m__36232__auto__ = (cljs.core.async.impl.protocols.remove_BANG_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,b);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.remove_BANG_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,b);
} else {
throw cljs.core.missing_protocol.call(null,"Buffer.remove!",b);
}
}
}
});
/**
* if room, add item to the buffer, returns b, called under chan mutex
*/
cljs.core.async.impl.protocols.add_BANG__STAR_ = (function cljs$core$async$impl$protocols$add_BANG__STAR_(b,itm){
if((!((b == null))) && (!((b.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 == null)))){
return b.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2(b,itm);
} else {
var x__36231__auto__ = (((b == null))?null:b);
var m__36232__auto__ = (cljs.core.async.impl.protocols.add_BANG__STAR_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,b,itm);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.add_BANG__STAR_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,b,itm);
} else {
throw cljs.core.missing_protocol.call(null,"Buffer.add!*",b);
}
}
}
});
/**
* called on chan closed under chan mutex, return ignored
*/
cljs.core.async.impl.protocols.close_buf_BANG_ = (function cljs$core$async$impl$protocols$close_buf_BANG_(b){
if((!((b == null))) && (!((b.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 == null)))){
return b.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1(b);
} else {
var x__36231__auto__ = (((b == null))?null:b);
var m__36232__auto__ = (cljs.core.async.impl.protocols.close_buf_BANG_[goog.typeOf(x__36231__auto__)]);
if(!((m__36232__auto__ == null))){
return m__36232__auto__.call(null,b);
} else {
var m__36232__auto____$1 = (cljs.core.async.impl.protocols.close_buf_BANG_["_"]);
if(!((m__36232__auto____$1 == null))){
return m__36232__auto____$1.call(null,b);
} else {
throw cljs.core.missing_protocol.call(null,"Buffer.close-buf!",b);
}
}
}
});
cljs.core.async.impl.protocols.add_BANG_ = (function cljs$core$async$impl$protocols$add_BANG_(var_args){
var G__40831 = arguments.length;
switch (G__40831) {
case 1:
return cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$1 = (function (b){
return b;
});
cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (b,itm){
if(!((itm == null))){
} else {
throw (new Error("Assert failed: (not (nil? itm))"));
}
return cljs.core.async.impl.protocols.add_BANG__STAR_.call(null,b,itm);
});
cljs.core.async.impl.protocols.add_BANG_.cljs$lang$maxFixedArity = 2;
/**
* @interface
*/
cljs.core.async.impl.protocols.UnblockingBuffer = function(){};
//# sourceMappingURL=protocols.js.map?rel=1517021944696
@@ -0,0 +1 @@
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/core\/async\/impl\/protocols.js","sources":["protocols.cljs?rel=1517021944697"],"lineCount":311,"mappings":";AAQA;;AAEA,gDAAA,hDAAaA;AAEb,AAAA;AAAA;;;0CAAA,1CAAaM;;AAAb;;;4CAAA,5CACGC,gGAAOC,KAAKC;AADf,AAAA,GAAA,CAAA,EAAA,SAAA,YAAA,EAAA,CAAA,mEAAA,1FACUD,uBAAAA;AADV,OACUA,gEAAAA,KAAKC;;AADf,IAAAR,mBAAA,EAAA,SAAA,OAAA,fACUO,oBAAAA;IADVN,mBAAA,CAAAC,0CAAA,AAAAC,YAAAH;AAAA,AAAA,GAAA,EAAA,CAAAC,oBAAA;AAAA,OAAAA,2BACUM,KAAKC;;AADf,IAAAP,uBAAA,CAAAC,0CAAA;AAAA,AAAA,GAAA,EAAA,CAAAD,wBAAA;AAAA,OAAAA,+BACUM,KAAKC;;AADf,MAAA,AAAAJ,qCAAA,iBACUG;;;;;;AADV,AAGA,AAAA;AAAA;;;2CAAA,3CAAaG;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EG;AAFN,AAGK,GAAQ,EAAK,QAAA,PAAMA;AAAnB;AAAA,AAAA,MAAA,KAAAK,MAAA;;;AACA,OAACN,yDAAMF,EAAEG;;;AAJd,AAAA,mEAAA,nEAAMI;;AAAN,AAOA,AAAA;AAAA;;;kDAAA,lDAAaE;;AAAb","names":["cljs.core.async.impl.pLine truncated
@@ -0,0 +1,167 @@
;; Copyright (c) Rich Hickey and contributors. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns cljs.core.async.impl.timers
(:require [cljs.core.async.impl.protocols :as impl]
[cljs.core.async.impl.channels :as channels]
[cljs.core.async.impl.dispatch :as dispatch]))
(def MAX_LEVEL 15) ;; 16 levels
(def P (/ 1 2))
(defn random-level
([] (random-level 0))
([level]
(if (and (< (.random js/Math) P)
(< level MAX_LEVEL))
(recur (inc level))
level)))
(deftype SkipListNode [key ^:mutable val forward]
ISeqable
(-seq [coll]
(list key val))
IPrintWithWriter
(-pr-writer [coll writer opts]
(pr-sequential-writer writer pr-writer "[" " " "]" opts coll)))
(defn skip-list-node
([level] (skip-list-node nil nil level))
([k v level]
(let [arr (make-array (inc level))]
(loop [i 0]
(when (< i (alength arr))
(aset arr i nil)
(recur (inc i))))
(SkipListNode. k v arr))))
(defn least-greater-node
([x k level] (least-greater-node x k level nil))
([x k level update]
(if-not (neg? level)
(let [x (loop [x x]
(if-let [x' (aget (.-forward x) level)]
(if (< (.-key x') k)
(recur x')
x)
x))]
(when-not (nil? update)
(aset update level x))
(recur x k (dec level) update))
x)))
(deftype SkipList [header ^:mutable level]
Object
(put [coll k v]
(let [update (make-array MAX_LEVEL)
x (least-greater-node header k level update)
x (aget (.-forward x) 0)]
(if (and (not (nil? x)) (== (.-key x) k))
(set! (.-val x) v)
(let [new-level (random-level)]
(when (> new-level level)
(loop [i (inc level)]
(when (<= i (inc new-level))
(aset update i header)
(recur (inc i))))
(set! level new-level))
(let [x (skip-list-node k v (make-array new-level))]
(loop [i 0]
(when (<= i level)
(let [links (.-forward (aget update i))]
(aset (.-forward x) i (aget links i))
(aset links i x)))))))))
(remove [coll k]
(let [update (make-array MAX_LEVEL)
x (least-greater-node header k level update)
x (aget (.-forward x) 0)]
(when (and (not (nil? x)) (== (.-key x) k))
(loop [i 0]
(when (<= i level)
(let [links (.-forward (aget update i))]
(if (identical? (aget links i) x)
(do
(aset links i (aget (.-forward x) i))
(recur (inc i)))
(recur (inc i))))))
(while (and (> level 0)
(nil? (aget (.-forward header) level)))
(set! level (dec level))))))
(ceilingEntry [coll k]
(loop [x header level level]
(if-not (neg? level)
(let [nx (loop [x x]
(let [x' (aget (.-forward x) level)]
(when-not (nil? x')
(if (>= (.-key x') k)
x'
(recur x')))))]
(if-not (nil? nx)
(recur nx (dec level))
(recur x (dec level))))
(when-not (identical? x header)
x))))
(floorEntry [coll k]
(loop [x header level level]
(if-not (neg? level)
(let [nx (loop [x x]
(let [x' (aget (.-forward x) level)]
(if-not (nil? x')
(if (> (.-key x') k)
x
(recur x'))
(when (zero? level)
x))))]
(if nx
(recur nx (dec level))
(recur x (dec level))))
(when-not (identical? x header)
x))))
ISeqable
(-seq [coll]
(letfn [(iter [node]
(lazy-seq
(when-not (nil? node)
(cons [(.-key node) (.-val node)]
(iter (aget (.-forward node) 0))))))]
(iter (aget (.-forward header) 0))))
IPrintWithWriter
(-pr-writer [coll writer opts]
(let [pr-pair (fn [keyval]
(pr-sequential-writer writer pr-writer "" " " "" opts keyval))]
(pr-sequential-writer writer pr-pair "{" ", " "}" opts coll))))
(defn skip-list []
(SkipList. (skip-list-node 0) 0))
(def timeouts-map (skip-list))
(def TIMEOUT_RESOLUTION_MS 10)
(defn timeout
"returns a channel that will close after msecs"
[msecs]
(let [timeout (+ (.valueOf (js/Date.)) msecs)
me (.ceilingEntry timeouts-map timeout)]
(or (when (and me (< (.-key me) (+ timeout TIMEOUT_RESOLUTION_MS)))
(.-val me))
(let [timeout-channel (channels/chan nil)]
(.put timeouts-map timeout timeout-channel)
(dispatch/queue-delay
(fn []
(.remove timeouts-map timeout)
(impl/close! timeout-channel))
msecs)
timeout-channel))))
@@ -0,0 +1 @@
{:rename-macros {}, :renames {}, :externs {Error {}, Math {random {}}, Array {}, Date {prototype {valueOf {}}}}, :use-macros {}, :excludes #{}, :name cljs.core.async.impl.timers, :imports nil, :requires {impl cljs.core.async.impl.protocols, cljs.core.async.impl.protocols cljs.core.async.impl.protocols, channels cljs.core.async.impl.channels, cljs.core.async.impl.channels cljs.core.async.impl.channels, dispatch cljs.core.async.impl.dispatch, cljs.core.async.impl.dispatch cljs.core.async.impl.dispatch}, :cljs.spec/speced-vars [], :uses nil, :defs {->SkipListNode {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :line 25, :column 10, :end-line 25, :end-column 22, :protocols #{cljs.core/ISeqable cljs.core/IPrintWithWriter}, :skip-protocol-flag #{cljs.core/ISeqable cljs.core/IPrintWithWriter}, :factory :positional, :arglists (quote ([key val forward]))}, :protocols #{cljs.core/ISeqable cljs.core/IPrintWithWriter}, :name cljs.core.async.impl.timers/->SkipListNode, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :end-column 22, :method-params ([key val forward]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :factory :positional, :line 25, :end-line 25, :max-fixed-arity 3, :fn-var true, :arglists (quote ([key val forward])), :skip-protocol-flag #{cljs.core/ISeqable cljs.core/IPrintWithWriter}}, timeout {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :line 152, :column 7, :end-line 152, :end-column 14, :arglists (quote ([msecs])), :doc "returns a channel that will close after msecs"}, :name cljs.core.async.impl.timers/timeout, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :end-column 14, :method-params ([msecs]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 152, :end-line 152, :max-fixed-arity 1, :fn-var true, :arglists (quote ([msecs])), :doc "returns a channel that will close after msecs"}, random-level {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :line 17, :column 7, :end-line 17, :end-column 19, :arglists (quote ([] [level])), :top-fn {:variadic false, :max-fixed-arity 1, :method-params ([] [level]), :arglists ([] [level]), :arglists-meta (nil nil)}}, :name cljs.core.async.impl.timers/random-level, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :end-column 19, :top-fn {:variadic false, :max-fixed-arity 1, :method-params ([] [level]), :arglists ([] [level]), :arglists-meta (nil nil)}, :method-params ([] [level]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 17, :end-line 17, :max-fixed-arity 1, :fn-var true, :arglists ([] [level])}, SkipList {:num-fields 2, :protocols #{cljs.core.async.impl.timers/Object cljs.core/ISeqable cljs.core/IPrintWithWriter}, :name cljs.core.async.impl.timers/SkipList, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :end-column 18, :type true, :column 10, :line 59, :record false, :end-line 59, :skip-protocol-flag #{cljs.core/ISeqable cljs.core/IPrintWithWriter}}, skip-list {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :line 145, :column 7, :end-line 145, :end-column 16, :arglists (quote ([]))}, :name cljs.core.async.impl.timers/skip-list, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :end-column 16, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 145, :end-line 145, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, ->SkipList {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :line 59, :column 10, :end-line 59, :end-column 18, :protocols #{cljs.core.async.impl.timers/Object cljs.core/ISeqable cljs.core/IPrintWithWriter}, :skip-protocol-flag #{cljs.core/ISeqable cljs.core/IPrintWithWriter}, :factory :positional, :arglists (quote ([header level]))}, :protocols #{cljs.core.async.impl.timers/Object cljs.core/ISeqable cljs.core/IPrintWithWriter}, :name cljs.core.async.impl.timers/->SkipList, :variadic false, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :end-column 18, :method-params ([header level]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :factory :positional, :line 59, :end-line 59, :max-fixed-arity 2, :fn-var true, :arglists (quote ([header level])), :skip-protocol-flag #{cljs.core/ISeqable cljs.core/IPrintWithWriter}}, MAX_LEVEL {:name cljs.core.async.impl.timers/MAX_LEVEL, :file "target/cljsbuild/public/js/out/cljs/core/async/impl/timers.cljs", :line 14, :column 1, :end-line 14, :end-column 15, :meta {:file "/home/didier/clojupyteLine truncated
+476
View File
@@ -0,0 +1,476 @@
// Compiled by ClojureScript 1.9.946 {}
goog.provide('cljs.core.async.impl.timers');
goog.require('cljs.core');
goog.require('cljs.core.async.impl.protocols');
goog.require('cljs.core.async.impl.channels');
goog.require('cljs.core.async.impl.dispatch');
cljs.core.async.impl.timers.MAX_LEVEL = (15);
cljs.core.async.impl.timers.P = ((1) / (2));
cljs.core.async.impl.timers.random_level = (function cljs$core$async$impl$timers$random_level(var_args){
var G__42207 = arguments.length;
switch (G__42207) {
case 0:
return cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$0();
break;
case 1:
return cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$0 = (function (){
return cljs.core.async.impl.timers.random_level.call(null,(0));
});
cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$1 = (function (level){
while(true){
if(((Math.random() < cljs.core.async.impl.timers.P)) && ((level < cljs.core.async.impl.timers.MAX_LEVEL))){
var G__42209 = (level + (1));
level = G__42209;
continue;
} else {
return level;
}
break;
}
});
cljs.core.async.impl.timers.random_level.cljs$lang$maxFixedArity = 1;
/**
* @constructor
* @implements {cljs.core.ISeqable}
* @implements {cljs.core.IPrintWithWriter}
*/
cljs.core.async.impl.timers.SkipListNode = (function (key,val,forward){
this.key = key;
this.val = val;
this.forward = forward;
this.cljs$lang$protocol_mask$partition0$ = 2155872256;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.timers.SkipListNode.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (coll){
var self__ = this;
var coll__$1 = this;
var x__36452__auto__ = self__.key;
return cljs.core._conj.call(null,(function (){var x__36452__auto____$1 = self__.val;
return cljs.core._conj.call(null,cljs.core.List.EMPTY,x__36452__auto____$1);
})(),x__36452__auto__);
});
cljs.core.async.impl.timers.SkipListNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (coll,writer,opts){
var self__ = this;
var coll__$1 = this;
return cljs.core.pr_sequential_writer.call(null,writer,cljs.core.pr_writer,"["," ","]",opts,coll__$1);
});
cljs.core.async.impl.timers.SkipListNode.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"key","key",124488940,null),cljs.core.with_meta(new cljs.core.Symbol(null,"val","val",1769233139,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"forward","forward",1083186224,null)], null);
});
cljs.core.async.impl.timers.SkipListNode.cljs$lang$type = true;
cljs.core.async.impl.timers.SkipListNode.cljs$lang$ctorStr = "cljs.core.async.impl.timers/SkipListNode";
cljs.core.async.impl.timers.SkipListNode.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.timers/SkipListNode");
});
cljs.core.async.impl.timers.__GT_SkipListNode = (function cljs$core$async$impl$timers$__GT_SkipListNode(key,val,forward){
return (new cljs.core.async.impl.timers.SkipListNode(key,val,forward));
});
cljs.core.async.impl.timers.skip_list_node = (function cljs$core$async$impl$timers$skip_list_node(var_args){
var G__42211 = arguments.length;
switch (G__42211) {
case 1:
return cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 3:
return cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$1 = (function (level){
return cljs.core.async.impl.timers.skip_list_node.call(null,null,null,level);
});
cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$3 = (function (k,v,level){
var arr = (new Array((level + (1))));
var i_42213 = (0);
while(true){
if((i_42213 < arr.length)){
(arr[i_42213] = null);
var G__42214 = (i_42213 + (1));
i_42213 = G__42214;
continue;
} else {
}
break;
}
return (new cljs.core.async.impl.timers.SkipListNode(k,v,arr));
});
cljs.core.async.impl.timers.skip_list_node.cljs$lang$maxFixedArity = 3;
cljs.core.async.impl.timers.least_greater_node = (function cljs$core$async$impl$timers$least_greater_node(var_args){
var G__42216 = arguments.length;
switch (G__42216) {
case 3:
return cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
case 4:
return cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$3 = (function (x,k,level){
return cljs.core.async.impl.timers.least_greater_node.call(null,x,k,level,null);
});
cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$4 = (function (x,k,level,update){
while(true){
if(!((level < (0)))){
var x__$1 = (function (){var x__$1 = x;
while(true){
var temp__5455__auto__ = (x__$1.forward[level]);
if(cljs.core.truth_(temp__5455__auto__)){
var x_SINGLEQUOTE_ = temp__5455__auto__;
if((x_SINGLEQUOTE_.key < k)){
var G__42218 = x_SINGLEQUOTE_;
x__$1 = G__42218;
continue;
} else {
return x__$1;
}
} else {
return x__$1;
}
break;
}
})();
if((update == null)){
} else {
(update[level] = x__$1);
}
var G__42219 = x__$1;
var G__42220 = k;
var G__42221 = (level - (1));
var G__42222 = update;
x = G__42219;
k = G__42220;
level = G__42221;
update = G__42222;
continue;
} else {
return x;
}
break;
}
});
cljs.core.async.impl.timers.least_greater_node.cljs$lang$maxFixedArity = 4;
/**
* @constructor
* @implements {cljs.core.async.impl.timers.Object}
* @implements {cljs.core.ISeqable}
* @implements {cljs.core.IPrintWithWriter}
*/
cljs.core.async.impl.timers.SkipList = (function (header,level){
this.header = header;
this.level = level;
this.cljs$lang$protocol_mask$partition0$ = 2155872256;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
cljs.core.async.impl.timers.SkipList.prototype.put = (function (k,v){
var self__ = this;
var coll = this;
var update = (new Array(cljs.core.async.impl.timers.MAX_LEVEL));
var x = cljs.core.async.impl.timers.least_greater_node.call(null,self__.header,k,self__.level,update);
var x__$1 = (x.forward[(0)]);
if((!((x__$1 == null))) && ((x__$1.key === k))){
return x__$1.val = v;
} else {
var new_level = cljs.core.async.impl.timers.random_level.call(null);
if((new_level > self__.level)){
var i_42223 = (self__.level + (1));
while(true){
if((i_42223 <= (new_level + (1)))){
(update[i_42223] = self__.header);
var G__42224 = (i_42223 + (1));
i_42223 = G__42224;
continue;
} else {
}
break;
}
self__.level = new_level;
} else {
}
var x__$2 = cljs.core.async.impl.timers.skip_list_node.call(null,k,v,(new Array(new_level)));
var i = (0);
while(true){
if((i <= self__.level)){
var links = (update[i]).forward;
(x__$2.forward[i] = (links[i]));
return (links[i] = x__$2);
} else {
return null;
}
break;
}
}
});
cljs.core.async.impl.timers.SkipList.prototype.remove = (function (k){
var self__ = this;
var coll = this;
var update = (new Array(cljs.core.async.impl.timers.MAX_LEVEL));
var x = cljs.core.async.impl.timers.least_greater_node.call(null,self__.header,k,self__.level,update);
var x__$1 = (x.forward[(0)]);
if((!((x__$1 == null))) && ((x__$1.key === k))){
var i_42225 = (0);
while(true){
if((i_42225 <= self__.level)){
var links_42226 = (update[i_42225]).forward;
if(((links_42226[i_42225]) === x__$1)){
(links_42226[i_42225] = (x__$1.forward[i_42225]));
var G__42227 = (i_42225 + (1));
i_42225 = G__42227;
continue;
} else {
var G__42228 = (i_42225 + (1));
i_42225 = G__42228;
continue;
}
} else {
}
break;
}
while(true){
if(((self__.level > (0))) && (((self__.header.forward[self__.level]) == null))){
self__.level = (self__.level - (1));
continue;
} else {
return null;
}
break;
}
} else {
return null;
}
});
cljs.core.async.impl.timers.SkipList.prototype.ceilingEntry = (function (k){
var self__ = this;
var coll = this;
var x = self__.header;
var level__$1 = self__.level;
while(true){
if(!((level__$1 < (0)))){
var nx = (function (){var x__$1 = x;
while(true){
var x_SINGLEQUOTE_ = (x__$1.forward[level__$1]);
if((x_SINGLEQUOTE_ == null)){
return null;
} else {
if((x_SINGLEQUOTE_.key >= k)){
return x_SINGLEQUOTE_;
} else {
var G__42229 = x_SINGLEQUOTE_;
x__$1 = G__42229;
continue;
}
}
break;
}
})();
if(!((nx == null))){
var G__42230 = nx;
var G__42231 = (level__$1 - (1));
x = G__42230;
level__$1 = G__42231;
continue;
} else {
var G__42232 = x;
var G__42233 = (level__$1 - (1));
x = G__42232;
level__$1 = G__42233;
continue;
}
} else {
if((x === self__.header)){
return null;
} else {
return x;
}
}
break;
}
});
cljs.core.async.impl.timers.SkipList.prototype.floorEntry = (function (k){
var self__ = this;
var coll = this;
var x = self__.header;
var level__$1 = self__.level;
while(true){
if(!((level__$1 < (0)))){
var nx = (function (){var x__$1 = x;
while(true){
var x_SINGLEQUOTE_ = (x__$1.forward[level__$1]);
if(!((x_SINGLEQUOTE_ == null))){
if((x_SINGLEQUOTE_.key > k)){
return x__$1;
} else {
var G__42234 = x_SINGLEQUOTE_;
x__$1 = G__42234;
continue;
}
} else {
if((level__$1 === (0))){
return x__$1;
} else {
return null;
}
}
break;
}
})();
if(cljs.core.truth_(nx)){
var G__42235 = nx;
var G__42236 = (level__$1 - (1));
x = G__42235;
level__$1 = G__42236;
continue;
} else {
var G__42237 = x;
var G__42238 = (level__$1 - (1));
x = G__42237;
level__$1 = G__42238;
continue;
}
} else {
if((x === self__.header)){
return null;
} else {
return x;
}
}
break;
}
});
cljs.core.async.impl.timers.SkipList.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (coll){
var self__ = this;
var coll__$1 = this;
var iter = ((function (coll__$1){
return (function cljs$core$async$impl$timers$iter(node){
return (new cljs.core.LazySeq(null,((function (coll__$1){
return (function (){
if((node == null)){
return null;
} else {
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [node.key,node.val], null),cljs$core$async$impl$timers$iter.call(null,(node.forward[(0)])));
}
});})(coll__$1))
,null,null));
});})(coll__$1))
;
return iter.call(null,(self__.header.forward[(0)]));
});
cljs.core.async.impl.timers.SkipList.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (coll,writer,opts){
var self__ = this;
var coll__$1 = this;
var pr_pair = ((function (coll__$1){
return (function (keyval){
return cljs.core.pr_sequential_writer.call(null,writer,cljs.core.pr_writer,""," ","",opts,keyval);
});})(coll__$1))
;
return cljs.core.pr_sequential_writer.call(null,writer,pr_pair,"{",", ","}",opts,coll__$1);
});
cljs.core.async.impl.timers.SkipList.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"header","header",1759972661,null),cljs.core.with_meta(new cljs.core.Symbol(null,"level","level",-1363938217,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
});
cljs.core.async.impl.timers.SkipList.cljs$lang$type = true;
cljs.core.async.impl.timers.SkipList.cljs$lang$ctorStr = "cljs.core.async.impl.timers/SkipList";
cljs.core.async.impl.timers.SkipList.cljs$lang$ctorPrWriter = (function (this__36169__auto__,writer__36170__auto__,opt__36171__auto__){
return cljs.core._write.call(null,writer__36170__auto__,"cljs.core.async.impl.timers/SkipList");
});
cljs.core.async.impl.timers.__GT_SkipList = (function cljs$core$async$impl$timers$__GT_SkipList(header,level){
return (new cljs.core.async.impl.timers.SkipList(header,level));
});
cljs.core.async.impl.timers.skip_list = (function cljs$core$async$impl$timers$skip_list(){
return (new cljs.core.async.impl.timers.SkipList(cljs.core.async.impl.timers.skip_list_node.call(null,(0)),(0)));
});
cljs.core.async.impl.timers.timeouts_map = cljs.core.async.impl.timers.skip_list.call(null);
cljs.core.async.impl.timers.TIMEOUT_RESOLUTION_MS = (10);
/**
* returns a channel that will close after msecs
*/
cljs.core.async.impl.timers.timeout = (function cljs$core$async$impl$timers$timeout(msecs){
var timeout = ((new Date()).valueOf() + msecs);
var me = cljs.core.async.impl.timers.timeouts_map.ceilingEntry(timeout);
var or__35498__auto__ = (cljs.core.truth_((function (){var and__35486__auto__ = me;
if(cljs.core.truth_(and__35486__auto__)){
return (me.key < (timeout + cljs.core.async.impl.timers.TIMEOUT_RESOLUTION_MS));
} else {
return and__35486__auto__;
}
})())?me.val:null);
if(cljs.core.truth_(or__35498__auto__)){
return or__35498__auto__;
} else {
var timeout_channel = cljs.core.async.impl.channels.chan.call(null,null);
cljs.core.async.impl.timers.timeouts_map.put(timeout,timeout_channel);
cljs.core.async.impl.dispatch.queue_delay.call(null,((function (timeout_channel,or__35498__auto__,timeout,me){
return (function (){
cljs.core.async.impl.timers.timeouts_map.remove(timeout);
return cljs.core.async.impl.protocols.close_BANG_.call(null,timeout_channel);
});})(timeout_channel,or__35498__auto__,timeout,me))
,msecs);
return timeout_channel;
}
});
//# sourceMappingURL=timers.js.map?rel=1517021945247
@@ -0,0 +1 @@
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/cljs\/core\/async\/impl\/timers.js","sources":["timers.cljs?rel=1517021945249"],"lineCount":476,"mappings":";AAQA;;;;;AAKA,wCAAA,xCAAKA;AACL,AAAKC,gCAAE,CAAA,MAAA;AAEP,AAAA,2CAAA,mDAAAC,9FAAME;AAAN,AAAA,IAAAD,WAAA,AAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,OAAAC;;;KAAA;AAAA,OAAAA,uEAAA,CAAA,UAAA;;;;AAAA,MAAA,KAAAC,MAAA,CAAA,8DAAA,AAAA;;;;;AAAA,AAAA,yEAAA,zEAAMD;AAAN,AACM,0DAAA,nDAACA;;;AADP,AAAA,yEAAA,zEAAMA,oFAEFE;;AAFJ,AAGI,GAAI,CAAK,CAAG,AAASC,gBAASN,oCACrB,CAAGK,QAAMN;AAChB,eAAO,SAAA,RAAKM;;;;AACZA;;;;;;AANN,AAAA,mEAAA,nEAAMF;;AAAN,AAQA,AAAA;;;;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,qFAAA,rFAASQ,gGAEAK;;AAFT,AAAA,eAAA,XAESA;AAFT,AAGI,IAAAC,mBAAMJ;AAAN,AAAA,OAAAK,0BAAA,iBAAAD,uBAAUH;AAAV,AAAA,OAAAI,+CAAAD,rBA05EA,AAAA6C;KA15EA7C;;;AAHJ,AAAA,AAAA,mGAAA,nGAASN,8GAMMK,KAAKG,OAAOC;;AAN3B,AAAA,eAAA,XAMeJ;AANf,AAOI,2EAAA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