Liking cljdoc? Tell your friends :D

Async Error

Build Status Dependencies Status

A Clojure(Script) library which provides core.async error handling utilities.

Install

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!

Usage

In Clojure

(:require [async-error.core :refer [go-try <?]])

In ClojureScript

(:require [async-error.core :refer-macros [go-try <?]])

In Clojure and ClojureScript

(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.

Related Work

License

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