Skip to content

clojure.core.async/chan

View this page on ClojureDocs

Type: function Added: Clojure unknown Examples: 4 Runnable: 0
([] [buf-or-n] [buf-or-n xform] [buf-or-n xform ex-handler])

Creates a channel with an optional buffer, an optional transducer (like (map f), (filter p) etc or a composition thereof), and an optional exception-handler. If buf-or-n is a number, will create and use a fixed buffer of that size. If a transducer is supplied a buffer must be specified. ex-handler must be a fn of one argument - if an exception occurs during transformation it will be called with the Throwable as an argument, and any non-nil return value will be placed in the channel.

Examples

by runexec on . May have evaluation errors.
by ertugrulcetin on . May have evaluation errors.
by liuchong on . May have evaluation errors.
by loeschzwerg on . May have evaluation errors.

See also


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