(act & sources)
Yields from the given sources (in sequence) but also discard their values. This is useful for sources with side effects.
Yields from the given sources (in sequence) but also discard their values. This is useful for sources with side effects.
(cat & args)
(combine & sources)
Combine multiple sources into one source, emitting values as they come.
When one stream errors, all streams are aborted and the error is propagated downstream.
When all streams end, the combined stream ends.
This function does not respect back pressure. That is, it drains values from the sources as soon as they come, regardless of whether values are being read from the combined stream.
Combine multiple sources into one source, emitting values as they come. When one stream errors, all streams are aborted and the error is propagated downstream. When all streams end, the combined stream ends. This function does not respect back pressure. That is, it drains values from the sources as soon as they come, regardless of whether values are being read from the combined stream.
(defer)
Returns [resolve, source]
. In the following example, the second stream
starts only after the first ends.
(let [[resolve source] (p/defer)] (p/stream (p/on-end resolve)) (p/stream (source (p/values [1 2 3]))))
Returns `[resolve, source]`. In the following example, the second stream starts only after the first ends. (let [[resolve source] (p/defer)] (p/stream (p/on-end resolve)) (p/stream (source (p/values [1 2 3]))))
(flatmap f)
(many & args)
(notify)
(pair)
(promise-source f)
Takes a function that returns a promise.
Takes a function that returns a promise.
(promise-through f)
Takes a function that takes a value and returns a promise.
Takes a function that takes a value and returns a promise.
(pushable)
(pushable done)
Returns a [push end source]
tuple where:
push
pushes an event into the source.end
ends the source.source
is the source.Returns a `[push end source]` tuple where: - `push` pushes an event into the source. - `end` ends the source. - `source` is the source.
(timeout-source val n)
Returns a source that behaves like once
except that it only yields the
value after n
milliseconds.
Returns a source that behaves like `once` except that it only yields the value after `n` milliseconds.
(timeout-through n)
Returns a through that blocks initially, but functions as a noop after n
milliseconds.
Returns a through that blocks initially, but functions as a noop after `n` milliseconds.
(values xs)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close