(promise-chan)
(promise-chan xform)
(promise-chan xform ex-handler)
Creates a promise channel with an optional transducer, and an optional
exception-handler. A promise channel can take exactly one value that consumers
will receive. Once full, puts complete but val is dropped (no transfer).
Consumers will block until either a value is placed in the channel or the
channel is closed. See chan for the semantics of xform and ex-handler.
Source
(defn promise-chan
"Creates a promise channel with an optional transducer, and an optional
exception-handler. A promise channel can take exactly one value that consumers
will receive. Once full, puts complete but val is dropped (no transfer).
Consumers will block until either a value is placed in the channel or the
channel is closed. See chan for the semantics of xform and ex-handler."
([] (promise-chan nil))
([xform] (promise-chan xform nil))
([xform ex-handler]
(chan (buffers/promise-buffer) xform ex-handler)))