Liking cljdoc? Tell your friends :D

seamless-async.core


*async?*clj

async? is a system global boolean flag, which may be used as hint to various mechanisms, that are capable of both a/sync operations, for impacting their execution mode. This flag reflects the overall general expectation of the system, as to whether its execution should be a/sync. This flag is merely an optional approach to global coordination, and may be ignored. Default: false.

*async?* is a system global boolean flag, which may be used as
hint to various mechanisms, that are capable of both a/sync operations,
for impacting their execution mode. This flag reflects the overall
general expectation of the system, as to whether its execution
should be a/sync. This flag is merely an optional approach to
global coordination, and may be ignored. Default: false.
sourceraw docstring

as-seqclj

(as-seq channel)
source

chan?clj

(chan? x)

Return true if x is a ManyToManyChannel.

Return true if x is a ManyToManyChannel.
sourceraw docstring

go-go?cljmacro

(go-go? async? & body)

Conditionally wraps code in a go block.

Conditionally wraps code in a go block.
sourceraw docstring

putc!clj

(putc! channel val)

Put & close. Asynchronously puts a val into channel, closing the channel when complete (nil values are not allowed). Returns true unless the channel is already closed.

Put & close. Asynchronously puts a val into channel, closing
the channel when complete (nil values are not allowed).
Returns true unless the channel is already closed.
sourceraw docstring

s->cljmacro

(s-> x & forms)

Seamless -> threading, which applies seamless async glue as needed, in case any of the threaded expressions is asynchronous.

Seamless -> threading, which applies seamless async glue as
needed, in case any of the threaded expressions is asynchronous.
sourceraw docstring

s->>cljmacro

(s->> x & forms)

Seamless ->> threading, which applies seamless async glue as needed, in case any of the threaded expressions is asynchronous.

Seamless ->> threading, which applies seamless async glue as
needed, in case any of the threaded expressions is asynchronous.
sourceraw docstring

scallbackclj

(scallback f
           &
           {:keys [callback err-callback]
            :or {callback identity err-callback identity}})

Takes a function f which expects callbacks, and optionally suitable callbacks implementations, and returns a non-blocking, streaming fn, that will be piping the result of the callbacks onto a channel. The returned fn has the same signature and logic as the original, but in place of a callback/err-callback fns, it takes simple flags :callback/:err-callback respectively, and returns a channel which will receive the result of the callbacks, then close. If no callbacks are provided, the identity fn will be used.

Takes a function f which expects callbacks, and optionally suitable
callbacks implementations, and returns a non-blocking, streaming fn,
that will be piping the result of the callbacks onto a channel.
The returned fn has the same signature and logic as the original,
but in place of a callback/err-callback fns, it takes simple
flags :callback/:err-callback respectively, and returns a channel
which will receive the result of the callbacks, then close.
If no callbacks are provided, the identity fn will be used.
sourceraw docstring

scond->cljmacro

(scond-> expr & clauses)

Seamless cond-> threading, which applies seamless async glue as needed, in case any of the threaded expressions is asynchronous.

Seamless cond-> threading, which applies seamless async glue as
needed, in case any of the threaded expressions is asynchronous.
sourceraw docstring

scond->>cljmacro

(scond->> expr & clauses)

Seamless cond->> threading, which applies seamless async glue as needed, in case any of the threaded expressions is asynchronous.

Seamless cond->> threading, which applies seamless async glue as
needed, in case any of the threaded expressions is asynchronous.
sourceraw docstring

sderefclj

(sderef f)
(sderef f timeout-ms timeout-val)

Takes a function f which returns a derefable ref, and optionally timeout-ms and timeout-val, and returns a non-blocking, streaming fn, which also accomplishes the deref. The returned fn has the exact same signature and logic as the original, but its outcome will get deref'd by the cached threads pool (see: clojure.core.async/thread-macro-executor), and it returns a channel which will receive the result once available, then close.

Takes a function f which returns a derefable ref, and optionally
timeout-ms and timeout-val, and returns a non-blocking, streaming fn,
which also accomplishes the deref.
The returned fn has the exact same signature and logic as the original,
but its outcome will get deref'd by the cached threads pool
(see: clojure.core.async/thread-macro-executor),
and it returns a channel which will receive the result once
available, then close.
sourceraw docstring

seamlessclj

(seamless f)

Takes a function f and returns a fn that can be seamlessly woven into an asynchronous flow. The returned fn has the exact same signature and logic as the original, but if any of its arguments originate in an async manner, they will be first asynchronously parked until their values are made available, and a channel will be returned immediately to the calling thread. The channel will receive the result (which may be a Throwable) once available, then close. However, if all values per input args are immediately available, the fn behaves as the original f. If an input arg turns out to be a Throwable, it is returned as the result under asynchronous conditions, else it will be thrown.

Takes a function f and returns a fn that can be seamlessly woven
into an asynchronous flow.
The returned fn has the exact same signature and logic as the original,
but if any of its arguments originate in an async manner, they will
be first asynchronously parked until their values are made available,
and a channel will be returned immediately to the calling thread. The
channel will receive the result (which may be a Throwable) once
available, then close.
However, if all values per input args are immediately available, the
fn behaves as the original f.
If an input arg turns out to be a Throwable, it is returned as the result
under asynchronous conditions, else it will be thrown.
sourceraw docstring

set-*async?*clj

(set-*async?* enabled?)

Sets the boolean state of the async? system global flag.

Sets the boolean state of the *async?* system global flag.
sourceraw docstring

smapclj

(smap & args)

Seamless map, which behaves as map, but in case f is an asynchronous op, a channel will be returned, containing the outcome collection, once available.

Seamless map, which behaves as map, but in case f is an
asynchronous op, a channel will be returned, containing the
outcome collection, once available.
sourceraw docstring

smapcatclj

(smapcat & args)

Seamless mapcat, which behaves as mapcat, but in case f is an asynchronous op, a channel will be returned, containing the outcome collection, once available.

Seamless mapcat, which behaves as mapcat, but in case f is an
asynchronous op, a channel will be returned, containing the
outcome collection, once available.
sourceraw docstring

sputc!clj

(sputc! channel val)

Safe put & close. Asynchronously puts a val into channel, closing the channel when complete (closes the channel immediately if val is nil). Returns true unless the channel is already closed, or nil if val is nil.

Safe put & close. Asynchronously puts a val into channel, closing
the channel when complete (closes the channel immediately if val is nil).
Returns true unless the channel is already closed, or nil if val is nil.
sourceraw docstring

sresolveclj

(sresolve coll)

Asynchronously replaces each channel encountered in coll with a single value taken from it. Returns a channel containing the outcome collection. If coll contains no channels, it is returned as is.

Asynchronously replaces each channel encountered in coll with
a single value taken from it.
Returns a channel containing the outcome collection.
If coll contains no channels, it is returned as is.
sourceraw docstring

streamfclj

(streamf f)

Takes a blocking function f, eg. a db query, and returns a non-blocking, streaming fn. The returned fn has the exact same signature and logic as the original, but its logic will be carried out by the cached threads pool (see: clojure.core.async/thread-macro-executor), and it returns a channel which will receive the result of the execution when completed (throwables included), then close.

Takes a blocking function f, eg. a db query, and returns a
non-blocking, streaming fn.
The returned fn has the exact same signature and logic as the original,
but its logic will be carried out by the cached threads pool
(see: clojure.core.async/thread-macro-executor),
and it returns a channel which will receive the result of
the execution when completed (throwables included), then close.
sourceraw docstring

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

× close