File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
src/main/clojure/clojure/core/async/flow Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 2323(defonce io-exec clojure.lang.Agent /soloExecutor )
2424(defonce compute-exec clojure.lang.Agent /pooledExecutor )
2525
26- (defn oid [x]
27- (symbol (str (-> x class .getSimpleName) " @" (-> x System/identityHashCode Integer/toHexString))))
28-
29- (defn exec->data [exec]
30- (let [ess (as-> (str exec) ^String es
31- (.substring es (inc (.lastIndexOf es " [" )) (.lastIndexOf es " ]" ))
32- (.split es " ," ))]
33- (merge {:id (oid exec)
34- :status (first ess)} ; ;TODO less fragile
35- (zipmap [:pool-size :active-threads :queued-tasks :completed-tasks ]
36- (map #(-> ^String % (.substring (inc (.lastIndexOf ^String % " " ))) Long.) (rest ess))))))
37-
3826(defn datafy [x]
3927 (condp instance? x
4028 clojure.lang.Fn (-> x str symbol)
41- ExecutorService (exec->data x)
29+ ExecutorService (str x)
4230 clojure.lang.Var (symbol x)
4331 (datafy/datafy x)))
4432
You can’t perform that action at this time.
0 commit comments