Skip to content

Commit 8c6b263

Browse files
committed
Added more info to async ns docstring
1 parent 0f340a9 commit 8c6b263

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,22 @@ Use the Java system property `clojure.core.async.vthreads` to control
4646
how core.async uses JDK 21+ virtual threads. The property can be one of
4747
the following values:
4848
49-
unset - always default to ioc when aot, and use virtual threads for
50-
`io-thread` blocks if available at runtime
51-
52-
\"target\" - target vthreads when compiling go and require them at runtime.
53-
use vthreads in io-thread when available
54-
55-
\"avoid\" - use ioc when compiling go (will work regardless), do not use
56-
vthreads for io-thread blocks
49+
unset - core.async will opportunistically use vthreads when available
50+
(≥ Java 21) and will otherwise use the old IOC impl. io-thread and :io
51+
thread pool will run on platform threads if vthreads are not available.
52+
If AOT compiling, go blocks will always use IOC so that the resulting
53+
bytecode works on all JVMs (so no change in compiled output)
54+
55+
\"target\" - means that you are targeting virtual threads. At runtime
56+
from source, go blocks will use vthreads if available, but will fall back
57+
to IOC if not available. If AOT compiling, go blocks are always compiled
58+
as normal Clojure code to be run on vthreads and will throw at runtime
59+
if vthreads are not available (Java <21)
60+
61+
\"avoid\" - means that vthreads will not be used - you can use this to
62+
minimize impacts if you are not yet ready to evaluate vthreads in your app.
63+
If AOT compiling, go blocks will use IOC. At runtime, io-thread and the
64+
:io thread pool use platform threads
5765
"
5866
(:refer-clojure :exclude [reduce transduce into merge map take partition
5967
partition-by bounded-count])

0 commit comments

Comments
 (0)