CrossClj

be40e078bdd2ca2cb92dc6dffb6249d9ab3f3152 docs

SourceDocs



RECENT

    rads/async-error

    Clojars

    Mar 7, 2018


    OWNER
    Alexander Kiel
    University Leipzig
    Leipzig, Germany
    alexanderkiel@gmx.net
    www.alexanderkiel.net

    Readme

    Index of all namespaces


    The README below is fetched from the published project artifact. Some relative links may be broken.

    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.2"]
    

    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.