File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
src/main/clojure/clojure/core/async/flow Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 2626(defn oid [x]
2727 (symbol (str (-> x class .getSimpleName) " @" (-> x System/identityHashCode Integer/toHexString))))
2828
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-
3829(defn exec->data [exec]
3930 (let [ess (as-> (str exec) ^String es
4031 (.substring es (inc (.lastIndexOf es " [" )) (.lastIndexOf es " ]" ))
4940 clojure.lang.Fn (-> x str symbol)
5041 ExecutorService (exec->data x)
5142 clojure.lang.Var (symbol x)
52- clojure.core.async.impl.channels.ManyToManyChannel (chan->data x)
5343 (datafy/datafy x)))
5444
5545(defn futurize ^Future [f {:keys [exec]}]
242232 (loop [nstatus nstatus, nstate nstate, msgs (seq msgs)]
243233 (if (or (nil? msgs) (= nstatus :exit ))
244234 [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)]]
248237 :priority true )]
249238 (if (= c control)
250239 (let [nnstatus (handle-command nstatus v)
You can’t perform that action at this time.
0 commit comments