Skip to content

Commit 700a859

Browse files
committed
additional docstrings around termination and go specialness.
1 parent 02ec389 commit 700a859

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,10 @@ return nil for unexpected contexts."
494494
core.async blocking ops (those ending in !!) and other blocking IO.
495495
496496
Returns a channel which will receive the result of the body when
497-
completed"
497+
completed.
498+
499+
go blocks will remain in memory only while their referenced channels
500+
remain in memory."
498501
[& body]
499502
((requiring-resolve 'clojure.core.async.impl.go/go-impl) &env body))
500503

@@ -533,8 +536,12 @@ return nil for unexpected contexts."
533536
"Executes the body in a thread, returning immediately to the calling
534537
thread. The body may do blocking I/O but must not do extended computation.
535538
Returns a channel which will receive the result of the body when completed,
536-
then close. When virtual threads are available in the runtime JVM (>= v21)
537-
then core.async will dispatch body to one."
539+
then close.
540+
541+
When virtual threads are available in the runtime JVM (>= v21)
542+
then core.async will dispatch body to one. Like regular threads, (and unlike
543+
go blocks) virtual threads must terminate ordinarily and will keep
544+
referenced resources alive until they do."
538545
[& body]
539546
`(thread-call (^:once fn* [] ~@body) :io))
540547

0 commit comments

Comments
 (0)