Liking cljdoc? Tell your friends :D

futurama.core


!<!cljmacro

(!<! v)

An improved macro version of <!, which also rethrows exceptions returned over the channel. Must be called INSIDE a (go ...) or (async ...) block.

  • Will return nil if closed.
  • Will park if nothing is available.
  • Will throw if an Exception is taken from port.
  • Will return the raw value if it is not a ReadPort
An improved macro version of <!, which also rethrows exceptions returned over the channel.
Must be called INSIDE a (go ...) or (async ...) block.
- Will return nil if closed.
- Will park if nothing is available.
- Will throw if an Exception is taken from port.
- Will return the raw value if it is not a ReadPort
sourceraw docstring

!<!!cljmacro

(!<!! v)

An improved macro version of <!!, which also rethrows exceptions returned over the channel. Must be called OUTSIDE a (go ...) or (async ...) block.

  • Will return nil if closed.
  • Will block if nothing is available.
  • Will throw if a Exception is taken from port.
  • Will return the raw value if it is not a ReadPort
An improved macro version of <!!, which also rethrows exceptions returned over the channel.
Must be called OUTSIDE a (go ...) or (async ...) block.
- Will return nil if closed.
- Will block if nothing is available.
- Will throw if a Exception is taken from port.
- Will return the raw value if it is not a ReadPort
sourceraw docstring

!<!*cljmacro

(!<!* coll)

Like !<! but works with collections of async values

Like !<! but works with collections of async values
sourceraw docstring

*thread-pool*clj

source

asynccljmacro

(async & body)

Asynchronously executes the body, returning immediately to the calling thread. Additionally, any visible calls to !<!, <!, >! and alt!/alts! channel operations within the body will block (if necessary) by 'parking' the calling thread rather than tying up an OS thread. Upon completion of the operation, the body will be resumed.

async blocks should not (either directly or indirectly) perform operations that may block indefinitely. Doing so risks depleting the fixed pool of go block threads, causing all go block processing to stop. This includes core.async blocking ops (those ending in !!) and other blocking IO.

Returns a channel which will receive the result of the body when completed; the pool used can be specified via *thread-pool* binding.

Asynchronously executes the body, returning immediately to the
calling thread. Additionally, any visible calls to !<!, <!, >! and alt!/alts!
channel operations within the body will block (if necessary) by
'parking' the calling thread rather than tying up an OS thread.
Upon completion of the operation, the body will be resumed.

async blocks should not (either directly or indirectly) perform operations
that may block indefinitely. Doing so risks depleting the fixed pool of
go block threads, causing all go block processing to stop. This includes
core.async blocking ops (those ending in !!) and other blocking IO.

Returns a channel which will receive the result of the body when
completed; the pool used can be specified via `*thread-pool*` binding.
sourceraw docstring

async!cljmacro

(async! port & body)

Asynchronously executes the body, returning port immediately to the calling thread. Additionally, any visible calls to !<!, <!, >! and alt!/alts! channel operations within the body will block (if necessary) by 'parking' the calling thread rather than tying up an OS thread. Upon completion of the operation, the body will be resumed.

The success or failure output will be put! in port.

async blocks should not (either directly or indirectly) perform operations that may block indefinitely. Doing so risks depleting the fixed pool of go block threads, causing all go block processing to stop. This includes core.async blocking ops (those ending in !!) and other blocking IO.

Returns a channel which will receive the result of the body when completed; the pool used can be specified via *thread-pool* binding.

Asynchronously executes the body, returning `port` immediately to the
calling thread. Additionally, any visible calls to !<!, <!, >! and alt!/alts!
channel operations within the body will block (if necessary) by
'parking' the calling thread rather than tying up an OS thread.
Upon completion of the operation, the body will be resumed.

The success or failure output will be put! in `port`.

async blocks should not (either directly or indirectly) perform operations
that may block indefinitely. Doing so risks depleting the fixed pool of
go block threads, causing all go block processing to stop. This includes
core.async blocking ops (those ending in !!) and other blocking IO.

Returns a channel which will receive the result of the body when
completed; the pool used can be specified via `*thread-pool*` binding.
sourceraw docstring

async->cljmacro

(async-> v & call-seq)

Threads the expr through the forms which can return async result. Inserts v as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc.

Threads the expr through the forms which can return async result.
Inserts v as the second item in the first form, making a list of it
if it is not a list already. If there are more forms, inserts the
first form as the second item in second form, etc.
sourceraw docstring

async->>cljmacro

(async->> v & call-seq)

Threads the expr through the forms which can return async result. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc.

Threads the expr through the forms which can return async result.
Inserts x as the last item in the first form, making a list of it
if it is not a list already. If there are more forms, inserts the
first form as the last item in second form, etc.
sourceraw docstring

async-every?clj

(async-every? pred coll)

Returns true if (pred x) is logical true for every x in coll, else false.

Returns true if (pred x) is logical true for every x in coll, else false.
sourceraw docstring

async-forcljmacro

(async-for bindings & body)

works like a for macro, but supports core.async operations. bindings are initially bound and collected, then the data is iterated over using a loop and the output collected; note that only the body of the for can contain <! and !<! calls. This is implicitly wrapped in an async block.

works like a for macro, but supports core.async operations.
bindings are initially bound and collected, then the data is iterated
over using a loop and the output collected; note that only the body of
the for can contain `<!` and `!<!` calls. This is implicitly wrapped in
an `async` block.
sourceraw docstring

async-mapclj

(async-map f coll & coll-seq)

Asynchronously returns the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments.

Asynchronously returns the result of applying f to
the set of first items of each coll, followed by applying f to the
set of second items in each coll, until any one of the colls is
exhausted.  Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments.
sourceraw docstring

async-postwalkclj

(async-postwalk f form)

Performs a depth-first, post-order traversal of form. Calls f on each sub-form, uses f's return value in place of the original. Recognizes all Clojure data structures. Consumes seqs as with doall.

Performs a depth-first, post-order traversal of form.  Calls f on
each sub-form, uses f's return value in place of the original.
Recognizes all Clojure data structures. Consumes seqs as with doall.
sourceraw docstring

async-prewalkclj

(async-prewalk f form)

Like postwalk, but does pre-order traversal.

Like postwalk, but does pre-order traversal.
sourceraw docstring

async-reduceclj

(async-reduce f coll)
(async-reduce f init coll)

Like core/reduce except, when init is not provided, (f) is used, and async results are read with !<!.

Like core/reduce except, when init is not provided, (f) is used, and async results are read with !<!.
sourceraw docstring

async-someclj

(async-some pred coll)

Concurrently executes (pred x) and returns the first returned logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll). Please beware that unlike clojure.core/some this function returns the first asynchronous result that completes and evaluates to logical true, but not necessarily the first one in sequential order.

Concurrently executes (pred x) and returns the first returned
logical true value of (pred x) for any x in coll, else nil.
One common idiom is to use a set as pred, for example
this will return :fred if :fred is in the sequence, otherwise nil:
(some #{:fred} coll). Please beware that unlike `clojure.core/some`
this function returns the first asynchronous result that completes
and evaluates to logical true, but not necessarily the first one
in sequential order.
sourceraw docstring

async-walkclj

(async-walk inner outer form)

Traverses form, an arbitrary data structure. inner and outer are functions. Applies inner to each element of form, building up a data structure of the same type, then applies outer to the result. Recognizes all Clojure data structures. Consumes seqs as with doall.

Traverses form, an arbitrary data structure.  inner and outer are
functions.  Applies inner to each element of form, building up a
data structure of the same type, then applies outer to the result.
Recognizes all Clojure data structures. Consumes seqs as with doall.
sourceraw docstring

async?clj

(async? v)

returns true if v instance-satisfies? core.async's ReadPort

returns true if v instance-satisfies? core.async's `ReadPort`
sourceraw docstring

completable-futurecljmacro

(completable-future & body)

Asynchronously invokes the body inside a completable future, preserves the current thread binding frame, using by default the ForkJoinPool/commonPool, the pool used can be specified via *thread-pool* binding.

Asynchronously invokes the body inside a completable future, preserves the current thread binding frame,
using by default the `ForkJoinPool/commonPool`, the pool used can be specified via `*thread-pool*` binding.
sourceraw docstring

default-poolclj

Default ExecutorService used, corresponds with a FixedThreadPool as many threads as available processors.

Default ExecutorService used, corresponds with a FixedThreadPool as many threads as available processors.
sourceraw docstring

dispatchclj

(dispatch f)

dispatch the function by submitting it to the *thread-pool*

dispatch the function by submitting it to the `*thread-pool*`
sourceraw docstring

fixed-threadpoolclj

(fixed-threadpool)
(fixed-threadpool n)

Creates a fixed-threadpool, by default uses the number of available processors.

Creates a fixed-threadpool, by default uses the number of available processors.
sourceraw docstring

rethrow-exceptionclj

(rethrow-exception v)

throw v if it is an Exception

throw v if it is an Exception
sourceraw docstring

unwrap-exceptionclj

(unwrap-exception ex)

unwraps an ExecutionException or CompletionException via ex-cause until the root exception is returned

unwraps an ExecutionException or CompletionException via ex-cause until the root exception is returned
sourceraw docstring

with-poolcljmacro

(with-pool pool & body)

Utility macro which binds thread-pool to the supplied pool and then evaluates the body.

Utility macro which binds *thread-pool* to the supplied pool and then evaluates the `body`.
sourceraw docstring

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

× close