Skip to content

rads/async-error

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Clojure 100.0%