A Clojure(Script) library which provides core.async error handling utilities.
To install, just add the following to your project dependencies:
[org.clojars.akiel/async-error "0.3"]
Needs at least core.async v0.3.465!
(:require [async-error.core :refer [go-try <?]])
(:require [async-error.core :refer-macros [go-try <?]])
(defn read-both [ch-a ch-b]
(go-try
(let [a (<? ch-a)
b (<? ch-b)]
[a b])))
This function returns a channel conveying either a vector of a and b or one of the errors conveyed by ch-a or ch-b. It will never read from ch-b if ch-a returns an error.
Copyright © 2015 Alexander Kiel
Distributed under the Eclipse Public License, the same as Clojure.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close