Unichannel-wait added.

This commit is contained in:
2026-07-06 15:17:43 +02:00
parent 751099152b
commit e14494f3b3
4 changed files with 29 additions and 2 deletions
+9
View File
@@ -124,6 +124,15 @@ native close operation. For port-channel wrappers this delegates to
@racket[close-port-channel]. Calling @racket[uni-channel-close] more than once is
safe.}
@defproc[(uni-channel-wait [ch uni-channel?]) void?]{
Waits until the underlying channel worker has stopped, when the backend has such
a worker. For @racket['port] channels this delegates to
@racket[port-channel-wait]. This is mainly useful for output port-channels: call
@racket[uni-channel-close] first to enqueue the close marker, then
@racket[uni-channel-wait] to wait until all queued values have been written and
the writer thread has stopped. For @racket['async] and @racket['place] channels,
this returns immediately.}
@defproc[(uni-channel-closed? [ch uni-channel?]) boolean?]{
Returns true when @racket[uni-channel-close] has been called on @racket[ch].}