(consume ch f)
Takes values repeatedly from channels and applies f to them.
The opposite of produce.
Stops consuming values when the channel is closed.
Takes values repeatedly from channels and applies f to them. The opposite of produce. Stops consuming values when the channel is closed.
(consume-blocking ch f)
Takes values repeatedly from channels and applies f to them.
The opposite of produce.
Stops consuming values when the channel is closed.
Takes values repeatedly from channels and applies f to them. The opposite of produce. Stops consuming values when the channel is closed.
(consume-blocking? ch f)
Takes values repeatedly from channels and applies f to them. Recurs only when f returns a non false-y value.
The opposite of produce.
Stops consuming values when the channel is closed.
Takes values repeatedly from channels and applies f to them. Recurs only when f returns a non false-y value. The opposite of produce. Stops consuming values when the channel is closed.
(consume? ch f)
Takes values repeatedly from channels and applies f to them. Recurs only when f returns a non false-y value.
The opposite of produce.
Stops consuming values when the channel is closed.
Takes values repeatedly from channels and applies f to them. Recurs only when f returns a non false-y value. The opposite of produce. Stops consuming values when the channel is closed.
(produce ch f)
(produce ch f close?)
Puts the contents repeatedly calling f into the supplied channel.
By default the channel will be closed after the items are copied, but can be determined by the close? parameter.
Returns a channel which will close after the items are copied.
Based on clojure.core.async/onto-chan. Equivalent to (onto-chan ch (repeatedly f)) but cuts out the seq.
Puts the contents repeatedly calling f into the supplied channel. By default the channel will be closed after the items are copied, but can be determined by the close? parameter. Returns a channel which will close after the items are copied. Based on clojure.core.async/onto-chan. Equivalent to (onto-chan ch (repeatedly f)) but cuts out the seq.
(produce-blocking ch f)
(produce-blocking ch f close?)
Like produce
but blocking in a thread.
Like `produce` but blocking in a thread.
(produce-bound-blocking ch f close? pre post)
Like produce-blocking
, but calls pre
and post
in the context
of the thread.
The value returned by pre
is passed to f
and post
.
pre
is called before the loop, post
after it exhausts.
Useful for non thread safe objects which throw upon being accessed from different threads.
Like `produce-blocking`, but calls `pre` and `post` in the context of the thread. The value returned by `pre` is passed to `f` and `post`. `pre` is called before the loop, `post` after it exhausts. Useful for non thread safe objects which throw upon being accessed from different threads.
(split* f ch m)
Takes a channel, function f :: v -> k and a map of keys to channels k -> ch, routing the values v from the input channel to the channel such that (f v) -> ch.
(get m (f v)) must be non-nil for every v!
Takes a channel, function f :: v -> k and a map of keys to channels k -> ch, routing the values v from the input channel to the channel such that (f v) -> ch. (get m (f v)) must be non-nil for every v!
(split-maybe f ch m)
Takes a channel, function f :: v -> k and a map of keys to channels k -> ch, routing the values v from the input channel to the channel such that (f v) -> ch.
If (f v) is not in m, the value is dropped
Takes a channel, function f :: v -> k and a map of keys to channels k -> ch, routing the values v from the input channel to the channel such that (f v) -> ch. If (f v) is not in m, the value is dropped
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close