Small extensions and improvements on top of core.async
Some bits shamelessly stolen from @mpenet's jet, See https://github.com/mpenet/jet for original
Small extensions and improvements on top of core.async Some bits shamelessly stolen from @mpenet's jet, See https://github.com/mpenet/jet for original
(put! ch msg backpressure!)
(put! ch msg backpressure! close!)
Takes a ch
, a msg
, a single arg function that when passed
true
enables backpressure and when passed false
disables it,
and a no-arg function which, when invoked, closes the upstream
source.
Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure and when passed `false` disables it, and a no-arg function which, when invoked, closes the upstream source.
(timeout-pipe tmval from to)
(timeout-pipe max-wait from to close?)
A variation on clojure.core.async/pipe
which will
close if no input is submitted within a given interval.
A variation on `clojure.core.async/pipe` which will close if no input is submitted within a given interval.
(validating-chan spec buf-or-n)
(validating-chan spec buf-or-n error-value)
(validating-chan spec buf-or-n error-value always-assert?)
A chan which ensures that values produced
to it match a given spec. Failing to match the spec
will produce error-value
on the channel.
When error-value
is a function, call it with no
args to produce the error value, or produce
error-value
itself.
When always-assert?
is provided, force asserts,
regardless of the value of *clojure.core/compile-asserts*
,
otherwise, and by default honor the value.
The 1-arity version produces nil on the chan in case of errors.
A chan which ensures that values produced to it match a given spec. Failing to match the spec will produce `error-value` on the channel. When `error-value` is a function, call it with no args to produce the error value, or produce `error-value` itself. When `always-assert?` is provided, force asserts, regardless of the value of `*clojure.core/compile-asserts*`, otherwise, and by default honor the value. The 1-arity version produces nil on the chan in case of errors.
(validating-fn spec always-assert?)
Yield correct predicate based on assertion preference.
Yield correct predicate based on assertion preference.
(validating-promise-chan spec)
(validating-promise-chan spec error-value)
(validating-promise-chan spec error-value always-assert?)
A promise chan which ensures that values produced
to it match a given spec. Failing to match the spec
will produce error-value
on the channel.
When error-value
is a function, call it with no
args to produce the error value, or produce
error-value
itself.
When always-assert?
is provided, force asserts,
regardless of the value of *clojure.core/compile-asserts*
,
otherwise, and by default honor the value.
The 1-arity version produces nil on the chan in case of errors.
A promise chan which ensures that values produced to it match a given spec. Failing to match the spec will produce `error-value` on the channel. When `error-value` is a function, call it with no args to produce the error value, or produce `error-value` itself. When `always-assert?` is provided, force asserts, regardless of the value of `*clojure.core/compile-asserts*`, otherwise, and by default honor the value. The 1-arity version produces nil on the chan in case of errors.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close