Liking cljdoc? Tell your friends :D

clojure.more.async


consume

(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.
sourceraw docstring

consume-blocking

(consume-blocking ch f)

Runs consume-blocking* in s thread.

Runs `consume-blocking*` in s thread.
sourceraw docstring

consume-blocking*

(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.
sourceraw docstring

consume-blocking?

(consume-blocking? ch f)

Runs consume-blocking?* in s thread.

Runs `consume-blocking?*` in s thread.
sourceraw docstring

consume-blocking?*

(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.
sourceraw docstring

consume?

(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.
sourceraw docstring

control

(control f cf ctl)

Wraps f with control function cf such that f will be invoked when: cf returns a truthy value for a value taken from ctl channel or there is no signal on ctl channel to take immidiately

Wraps f with control function cf such that f will be invoked when:
cf returns a truthy value for a value taken from ctl channel or
there is no signal on ctl channel to take immidiately
sourceraw docstring

do-mux

(do-mux chans-map out)
source

fan!

(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.
sourceraw docstring

interrupt-controlmacro

(interrupt-control f ctl)
(interrupt-control f cf ctl)
(interrupt-control f cf ctl & es-ehs)

Like control but only checks ctl channel if f throws. takes an optional seq of exceptions and exception handlers to handle different exceptions which can be thrown by f.

Like `control` but only checks ctl channel if f throws.
takes an optional seq of exceptions and exception handlers to
handle different exceptions which can be thrown by f.
sourceraw docstring

interrupt-controlsmacro

(interrupt-controls f ctl & cfs-es-ehs)
source

merge!

(merge! from to)
source

muxmacro

(mux to & from)
source

produce

(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.
sourceraw docstring

produce-blocking

(produce-blocking ch f)
(produce-blocking ch f close?)

Like produce-blocking* but takes a thread.

Like `produce-blocking*` but takes a thread.
sourceraw docstring

produce-blocking*

(produce-blocking* ch f close?)

Like produce but blocking.

Like `produce` but blocking.
sourceraw docstring

produce-bound-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.
sourceraw docstring

produce-bound-blocking*

(produce-bound-blocking* ch f close? pre post)
source

reductions*

(reductions* rf init in out)
(reductions* rf init in out close?)

Like core/reductions, but takes elements from in channel and produces them to out channel.

Like core/reductions, but takes elements from in channel and
produces them to out channel.
sourceraw docstring

split*

(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! 
sourceraw docstring

split-maybe

(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
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close