Liking cljdoc? Tell your friends :D

clojure.more.async


consumeclj

(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-blockingclj

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

consume-blocking?clj

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

consume?clj

(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

produceclj

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

produce-blockingclj

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

Like produce but blocking in a thread.

Like `produce` but blocking in a thread.
sourceraw docstring

produce-bound-blockingclj

(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

split*clj

(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-maybeclj

(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