Skip to content

Commit

Permalink
no more best-fit- prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
fogus committed Jan 28, 2025
1 parent ac38b20 commit 0ca5026
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/main/clojure/clojure/core/async.clj
Original file line number Diff line number Diff line change
Expand Up @@ -468,15 +468,7 @@ to catch and handle."
thread. Returns a channel which will receive the result of calling
f when completed, then close."
[f]
(exec-services/best-fit-thread-call f :mixed))

(defmacro io-thread
"Executes the body in a thread intended for blocking I/O workloads,
returning immediately to the calling thread. The body must not do
extended computation (if so, use 'thread' instead). Returns a channel
which will receive the result of the body when completed, then close."
[& body]
`(exec-services/best-fit-thread-call (^:once fn* [] ~@body) :io))
(exec-services/thread-call f :mixed))

(defmacro thread
"Executes the body in another thread, returning immediately to the
Expand All @@ -485,6 +477,14 @@ to catch and handle."
[& body]
`(thread-call (^:once fn* [] ~@body)))

(defmacro io-thread
"Executes the body in a thread intended for blocking I/O workloads,
returning immediately to the calling thread. The body must not do
extended computation (if so, use 'thread' instead). Returns a channel
which will receive the result of the body when completed, then close."
[& body]
`(exec-services/thread-call (^:once fn* [] ~@body) :io))

;;;;;;;;;;;;;;;;;;;; ops ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defmacro go-loop
Expand Down
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/core/async/impl/exec/services.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(defonce ^ExecutorService compute-executor
(Executors/newCachedThreadPool (conc/counted-thread-factory "async-compute-%d" true)))

(defn best-fit-thread-call
(defn thread-call
[f exec]
(let [c (clojure.core.async/chan 1)
^ExecutorService e (case exec
Expand Down

0 comments on commit 0ca5026

Please sign in to comment.