Liking cljdoc? Tell your friends :D

full.async


<!!*clj

(<!!* chs)

<!*cljmacro

(<!* chs)

Takes one result from each channel and returns them as a collection. The results maintain the order of channels.

Takes one result from each channel and returns them as a collection.
The results maintain the order of channels.
raw docstring

<<!cljmacro

(<<! ch)

Takes multiple results from a channel and returns them as a vector. The input channel must be closed.

Takes multiple results from a channel and returns them as a vector.
The input channel must be closed.
raw docstring

<<!!clj

(<<!! ch)

<<?cljmacro

(<<? ch)

Takes multiple results from a channel and returns them as a vector. Throws if any result is an exception.

Takes multiple results from a channel and returns them as a vector.
Throws if any result is an exception.
raw docstring

<<??clj

(<<?? ch)

<?cljmacro

(<? ch)

Same as core.async <! but throws an exception if the channel returns a throwable object. Also will not crash if channel is nil.

Same as core.async <! but throws an exception if the channel returns a
throwable object. Also will not crash if channel is nil.
raw docstring

<?*cljmacro

(<?* chs)

Takes one result from each channel and returns them as a collection. The results maintain the order of channels. Throws if any of the channels returns an exception.

Takes one result from each channel and returns them as a collection.
The results maintain the order of channels. Throws if any of the
channels returns an exception.
raw docstring

<??clj

(<?? ch)

Same as core.async <!! but throws an exception if the channel returns a throwable object. Also will not crash if channel is nil.

Same as core.async <!! but throws an exception if the channel returns a
throwable object. Also will not crash if channel is nil.
raw docstring

<??*clj

(<??* chs)

alts?cljmacro

(alts? ports)

Same as core.async alts! but throws an exception if the channel returns a throwable object.

Same as core.async alts! but throws an exception if the channel returns a
throwable object.
raw docstring

concat>>clj/s

(concat>> & cs)

Concatenates two or more channels. First takes all values from first channel and supplies to output channel, then takes all values from second channel and so on. Similiar to core.async/merge but maintains the order of values.

Concatenates two or more channels. First takes all values from first channel
and supplies to output channel, then takes all values from second channel and
so on. Similiar to core.async/merge but maintains the order of values.
raw docstring

count>clj/s

(count> ch)

Counts items in a channel. Returns a channel with the item count.

Counts items in a channel. Returns a channel with the item count.
raw docstring

debounce>>clj/s

(debounce>> ch interval)

Debounces channel. Forwards first item from input channel to output immediately. After that one item every interval ms (if any). If there are more items in between, they are dropped.

Debounces channel. Forwards first item from input channel to output
immediately. After that one item every interval ms (if any). If there are more
items in between, they are dropped.
raw docstring

engulfclj/s

(engulf & cs)

Similiar to dorun. Simply takes messages from channels but does nothing with them. Returns channel that will close when all messages have been consumed.

Similiar to dorun. Simply takes messages from channels but does nothing with
them. Returns channel that will close when all messages have been consumed.
raw docstring

exception?clj/s

(exception? x)

go-retrycljmacro

(go-retry {:keys [exception retries delay error-fn should-retry-fn on-error]
           :or {error-fn nil retries 5 delay 1 on-error nil}}
          &
          body)

Attempts to evaluate a go block and retries it if should-retry-fn which is invoked with block's evaluation result evaluates to false. should-retry-fn is optional and by default it will simply check if result is of type Throwable (clj) / js/Error (cljs). If the evaluation still fails after given retries, the last failed result will be returned in channel. Parameters:

  • retries - how many times to retry (default 5 times)
  • delay - how long to wait in seconds between retries (default 1s)
  • should-retry-fn - function that is invoked with result of block's evaluation and should indicate whether to retry (if it returns true) or not (returns false)
  • error-fn - DEPRECATED, use should-retry-fn instead
Attempts to evaluate a go block and retries it if `should-retry-fn`
which is invoked with block's evaluation result evaluates to false.
`should-retry-fn` is optional and by default it will simply check if
result is of type Throwable (clj) / js/Error (cljs). If the evaluation
still fails after given retries, the last failed result will be
returned in channel.
Parameters:
* retries - how many times to retry (default 5 times)
* delay - how long to wait in seconds between retries (default 1s)
* should-retry-fn - function that is invoked with result of block's
                    evaluation and should indicate whether to retry
                    (if it returns true) or not (returns false)
* error-fn - DEPRECATED, use should-retry-fn instead
raw docstring

go-trycljmacro

(go-try & body)

Asynchronously executes the body in a go block. Returns a channel which will receive the result of the body when completed or an exception if one is thrown.

Asynchronously executes the body in a go block. Returns a channel which
will receive the result of the body when completed or an exception if one
is thrown.
raw docstring

partition-all>>clj/s

(partition-all>> n in-ch & {:keys [out-ch]})

Batches results from input channel into vectors of n size and supplies them to ouput channel. If any input result is an exception, it is put onto output channel directly and ouput channel is closed.

Batches results from input channel into vectors of n size and supplies
them to ouput channel. If any input result is an exception, it is put onto
output channel directly and ouput channel is closed.
raw docstring

pmap>>clj/s

(pmap>> f> parallelism in-ch)
(pmap>> f> parallelism out-ch in-ch)

Takes objects from in-ch, asynchrously applies function f> (function should return a channel), takes the result from the returned channel and if it's truthy, puts it in the out-ch. Returns the closed out-ch. Closes the returned channel when the input channel has been completely consumed and all objects have been processed. If out-ch is not provided, an unbuffered one will be used.

Takes objects from in-ch, asynchrously applies function f> (function should
return a channel), takes the result from the returned channel and if it's
truthy, puts it in the out-ch. Returns the closed out-ch. Closes the
returned channel when the input channel has been completely consumed and all
objects have been processed.
If out-ch is not provided, an unbuffered one will be used.
raw docstring

reduce>clj/s

(reduce> f> acc ch)

Performs a reduce on objects from ch with the function f> (which should return a channel). Returns a channel with the resulting value.

Performs a reduce on objects from ch with the function f> (which should return
a channel). Returns a channel with the resulting value.
raw docstring

thread-trycljmacro

(thread-try & body)

Asynchronously executes the body in a thread. Returns a channel which will receive the result of the body when completed or an exception if one is thrown.

Asynchronously executes the body in a thread. Returns a channel which
will receive the result of the body when completed or an exception if one
is thrown.
raw docstring

throw-if-throwableclj/s≠

(throw-if-throwable x)
clj

Helper method that checks if x is Throwable and if yes, wraps it in a new exception, passing though ex-data if any, and throws it. The wrapping is done to maintain a full stack trace when jumping between multiple contexts.

Helper method that checks if x is Throwable and if yes, wraps it in a new
exception, passing though ex-data if any, and throws it. The wrapping is done
to maintain a full stack trace when jumping between multiple contexts.
cljs

Helper method that checks if x is JavaScript Error. If it is, throws it, otherwise returns x.

Helper method that checks if x is JavaScript Error. If it is, throws it,
otherwise returns x.
raw docstring

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

× close