Skip to content

clojure.core.async/close!

View this page on ClojureDocs

Type: function Added: Clojure unknown Examples: 2 Runnable: 0
([chan])

Closes a channel. The channel will no longer accept any puts (they will be ignored). Data in the channel remains available for taking, until exhausted, after which takes will return nil. If there are any pending takes, they will be dispatched with nil. Closing a closed channel is a no-op. Returns nil.

Logically closing happens after all puts have been delivered. Therefore, any blocked or parked puts will remain blocked/parked until a taker releases them.

Examples

by ertugrulcetin on . May have evaluation errors.
by nvseenu on . May have evaluation errors.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.