File tree 1 file changed +2
-13
lines changed
src/main/clojure/clojure/core/async/flow
1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 26
26
(defn oid [x]
27
27
(symbol (str (-> x class .getSimpleName) " @" (-> x System/identityHashCode Integer/toHexString))))
28
28
29
- (defn chan->data
30
- [^clojure.core.async.impl.channels.ManyToManyChannel c]
31
- (let [b (.buf c)]
32
- {:buffer (if (some? b) (oid b) :none )
33
- :buffer-count (count b)
34
- :put-count (count (.puts c))
35
- :take-count (count (.takes c))
36
- :closed? (clojure.core.async.impl.protocols/closed? c)}))
37
-
38
29
(defn exec->data [exec]
39
30
(let [ess (as-> (str exec) ^String es
40
31
(.substring es (inc (.lastIndexOf es " [" )) (.lastIndexOf es " ]" ))
49
40
clojure.lang.Fn (-> x str symbol)
50
41
ExecutorService (exec->data x)
51
42
clojure.lang.Var (symbol x)
52
- clojure.core.async.impl.channels.ManyToManyChannel (chan->data x)
53
43
(datafy/datafy x)))
54
44
55
45
(defn futurize ^Future [f {:keys [exec]}]
242
232
(loop [nstatus nstatus, nstate nstate, msgs (seq msgs)]
243
233
(if (or (nil? msgs) (= nstatus :exit ))
244
234
[nstatus nstate]
245
- (let [m (if-some [m (first msgs)] m (throw (Exception. " messages must be non-nil" )))
246
- [v c] (async/alts!!
247
- [control [outc m]]
235
+ (let [[v c] (async/alts!!
236
+ [control [outc (first msgs)]]
248
237
:priority true )]
249
238
(if (= c control)
250
239
(let [nnstatus (handle-command nstatus v)
You can’t perform that action at this time.
0 commit comments