Skip to content

Commit b7466fb

Browse files
committedJan 29, 2025·
get out of executor datafy biz
1 parent 07de58f commit b7466fb

File tree

1 file changed

+1
-13
lines changed
  • src/main/clojure/clojure/core/async/flow

1 file changed

+1
-13
lines changed
 

‎src/main/clojure/clojure/core/async/flow/impl.clj

+1-13
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,10 @@
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

0 commit comments

Comments
 (0)
Please sign in to comment.