File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
src/main/clojure/clojure/core Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -468,15 +468,7 @@ to catch and handle."
468
468
thread. Returns a channel which will receive the result of calling
469
469
f when completed, then close."
470
470
[f]
471
- (exec-services/best-fit-thread-call f :mixed ))
472
-
473
- (defmacro io-thread
474
- " Executes the body in a thread intended for blocking I/O workloads,
475
- returning immediately to the calling thread. The body must not do
476
- extended computation (if so, use 'thread' instead). Returns a channel
477
- which will receive the result of the body when completed, then close."
478
- [& body]
479
- `(exec-services/best-fit-thread-call (^:once fn* [] ~@body) :io ))
471
+ (exec-services/thread-call f :mixed ))
480
472
481
473
(defmacro thread
482
474
" Executes the body in another thread, returning immediately to the
@@ -485,6 +477,14 @@ to catch and handle."
485
477
[& body]
486
478
`(thread-call (^:once fn* [] ~@body)))
487
479
480
+ (defmacro io-thread
481
+ " Executes the body in a thread intended for blocking I/O workloads,
482
+ returning immediately to the calling thread. The body must not do
483
+ extended computation (if so, use 'thread' instead). Returns a channel
484
+ which will receive the result of the body when completed, then close."
485
+ [& body]
486
+ `(exec-services/thread-call (^:once fn* [] ~@body) :io ))
487
+
488
488
; ;;;;;;;;;;;;;;;;;;; ops ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
489
489
490
490
(defmacro go-loop
Original file line number Diff line number Diff line change 22
22
(defonce ^ExecutorService compute-executor
23
23
(Executors/newCachedThreadPool (conc/counted-thread-factory " async-compute-%d" true )))
24
24
25
- (defn best-fit- thread-call
25
+ (defn thread-call
26
26
[f exec]
27
27
(let [c (clojure.core.async/chan 1 )
28
28
^ExecutorService e (case exec
You can’t perform that action at this time.
0 commit comments