File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
src/main/clojure/clojure/core/async/impl Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 8080 (.uncaughtException (Thread/currentThread ) ex))
8181 nil )
8282
83- (def construct-es
84- (let [esf (System/getProperty " clojure.core.async.esfactory" )]
85- (or
86- (and esf (requiring-resolve (symbol esf)))
87- (fn [workload]
88- (case workload
89- :compute (Executors/newCachedThreadPool (counted-thread-factory " async-compute-%d" true ))
90- :io (Executors/newCachedThreadPool (counted-thread-factory " async-io-%d" true ))
91- :mixed (Executors/newCachedThreadPool (counted-thread-factory " async-mixed-%d" true ))
92- (throw (IllegalArgumentException. (str " Illegal workload tag " workload))))))))
83+ (defn- sys-prop-call
84+ [prop otherwise]
85+ (let [esf (System/getProperty prop)
86+ esfn (or (and esf (requiring-resolve (symbol esf))) otherwise)]
87+ (esfn )))
88+
89+ (defn construct-es
90+ [workload]
91+ (case workload
92+ :compute (sys-prop-call " clojure.core.async.compute-es-fn"
93+ #(Executors/newCachedThreadPool (counted-thread-factory " async-compute-%d" true )))
94+ :io (sys-prop-call " clojure.core.async.io-es-fn"
95+ #(Executors/newCachedThreadPool (counted-thread-factory " async-io-%d" true )))
96+ :mixed (sys-prop-call " clojure.core.async.mixed-es-fn"
97+ #(Executors/newCachedThreadPool (counted-thread-factory " async-mixed-%d" true )))
98+ (throw (IllegalArgumentException. (str " Illegal workload tag " workload)))))
9399
94100(defonce ^ExecutorService mixed-executor (construct-es :mixed ))
95101
You can’t perform that action at this time.
0 commit comments