(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)
Runs consume-blocking*
in s thread.
Runs `consume-blocking*` in s thread.
(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.
Like consume
but blocking.
Takes values repeatedly from channels and applies f to them. The opposite of produce. Stops consuming values when the channel is closed. Like `consume` but blocking.
(consume-blocking? ch f)
Runs consume-blocking?*
in s thread.
Runs `consume-blocking?*` in s thread.
(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.
Like consume?
but blocking.
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. Like `consume?` but blocking.
(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.
(fan! f xf from to)
Partition values from from
by f
and apply xf
to each partition.
Useful for stateful transducer operating on streaming partitioned data
when the partitions aren't know a priori.
Warnings and caveats: creates a new channel and go block per new partition. Very bad for unbounded inputs.
Partition values from `from` by `f` and apply `xf` to each partition. Useful for stateful transducer operating on streaming partitioned data when the partitions aren't know a priori. Warnings and caveats: creates a new channel and go block per new partition. Very bad for unbounded inputs.
(produce ch f)
(produce ch f close?)
Puts the contents repeatedly calling f into the supplied channel.
By default the channel will be closed if f returns nil.
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 if f returns nil. 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-blocking*
but takes a thread.
Like `produce-blocking*` but takes a thread.
(produce-blocking* ch f close?)
Like produce
but blocking.
Like `produce` but blocking.
(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