@@ -462,17 +462,20 @@ to catch and handle."
462
462
[& body]
463
463
(#'clojure.core.async.impl.go/go-impl &env body))
464
464
465
- (defonce ^:private ^Executor thread-macro -executor
466
- (Executors/newCachedThreadPool (conc/counted-thread-factory " async-thread-%d" true )))
465
+ (defonce ^ExecutorService mixed -executor
466
+ (Executors/newCachedThreadPool (conc/counted-thread-factory " async-mixed- thread-%d" true )))
467
467
468
- (defonce ^:private ^ ExecutorService io-thread-exec
468
+ (defonce ^ExecutorService io-executor
469
469
(Executors/newCachedThreadPool (conc/counted-thread-factory " async-io-thread-%d" true )))
470
470
471
+ (defonce ^ExecutorService compute-executor
472
+ (Executors/newFixedThreadPool 8 (conc/counted-thread-factory " async-compute-thread-%d" true )))
473
+
471
474
(defn thread-call
472
475
" Executes f in another thread, returning immediately to the calling
473
476
thread. Returns a channel which will receive the result of calling
474
477
f when completed, then close."
475
- ([f] (thread-call f thread-macro -executor))
478
+ ([f] (thread-call f mixed -executor))
476
479
([f ^ExecutorService exec]
477
480
(let [c (chan 1 )]
478
481
(let [binds (Var/getThreadBindingFrame )]
@@ -493,7 +496,7 @@ to catch and handle."
493
496
extended computation (if so, use 'thread' instead). Returns a channel
494
497
which will receive the result of the body when completed, then close."
495
498
[& body]
496
- `(thread-call (^:once fn* [] ~@body) @#' io-thread-exec ))
499
+ `(thread-call (^:once fn* [] ~@body) io-executor ))
497
500
498
501
(defmacro thread
499
502
" Executes the body in another thread, returning immediately to the
0 commit comments