Skip to content

Commit e477c08

Browse files
committed
Tweaking docstring and using custom ExecutorService for io-threads
1 parent 4df69ea commit e477c08

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/clojure/clojure/core/async.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,16 @@ to catch and handle."
465465
(defonce ^:private ^Executor thread-macro-executor
466466
(Executors/newCachedThreadPool (conc/counted-thread-factory "async-thread-macro-%d" true)))
467467

468-
(defonce ^:private ^ExecutorService io-thread-exec thread-macro-executor)
468+
(defonce ^:private ^ExecutorService io-thread-exec
469+
(Executors/newCachedThreadPool (conc/counted-thread-factory "io-thread-macro-%d" true)))
469470

470471
(defmacro io-thread
471472
"Asynchronously executes the body in a thread compatible with I/O workload,
472473
returning immediately to the calling thread. Only blocking operations should
473474
be used in io-thread bodies.
474475
475-
io-thread blocks should not (either directly or indirectly) perform operations
476-
that never block and run pure compute operations. Parking ops
476+
io-thread bodies should not (either directly or indirectly) perform operations
477+
that never block nor run pure compute operations. Parking ops
477478
(i.e. <!, >! and alt!/alts!) used in io-thread bodies will throw at
478479
runtime.
479480

0 commit comments

Comments
 (0)