async/await for continuation-passing style (CPS) functions.
This library delivers async/await expressions for use with asynchronous functions that take resolve and raise callbacks as the last parameters (e.g. ring, clj-http...).
async/await for continuation-passing style (CPS) functions. This library delivers async/await expressions for use with asynchronous functions that take resolve and raise callbacks as the last parameters (e.g. ring, clj-http...).
If the raise callback in an async block throws, the exception will be logged with this function.
WARNING: If this function throws too the exception will be silently swallowed.
If the raise callback in an async block throws, the exception will be logged with this function. WARNING: If this function throws too the exception will be silently swallowed.
(async resolve raise & body)
Executes the body calling resolve with the result. Exceptions thrown by either the body or the resolve function will be raised calling raise.
Executes in the calling thread up to the first await clause. Execution is then resumed in the thread awaited function run its resolve callback in. This may be the calling thread.
Executes the body calling resolve with the result. Exceptions thrown by either the body or the resolve function will be raised calling raise. Executes in the calling thread up to the first await clause. Execution is then resumed in the thread awaited function run its resolve callback in. This may be the calling thread.
(await f & args)
Awaits asynchronous execution of continuation-passing style function f, applying it to args provided plus two extra callback functions: resolve and raise. Returns the value passed to resolve or throws the exception passed to raise. Must execute in an async block.
Awaits asynchronous execution of continuation-passing style function f, applying it to args provided plus two extra callback functions: resolve and raise. Returns the value passed to resolve or throws the exception passed to raise. Must execute in an async block.
(defn-async name doc-string? attr-map? [params*] body)
Same as defn but adds &resolve and &raise params and executes the body in an async block using those as callbacks. Only one arity is allowed.
Same as defn but adds &resolve and &raise params and executes the body in an async block using those as callbacks. Only one arity is allowed.
(fn-async name? [params*] body)
Same as fn but adds &resolve and &raise params and executes the body in an async block using those as callbacks. Only one arity is allowed.
Same as fn but adds &resolve and &raise params and executes the body in an async block using those as callbacks. Only one arity is allowed.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close