Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Commit

Permalink
0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
moea committed Aug 15, 2015
1 parent cbb1821 commit 9d154fa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject io.nervous/eulalie "0.6.1-SNAPSHOT"
(defproject io.nervous/eulalie "0.6.1"
:description "Asynchronous, pure-Clojure AWS client"
:url "https://github.com/nervous-systems/eulalie"
:license {:name "Unlicense" :url "http://unlicense.org/UNLICENSE"}
Expand Down
27 changes: 27 additions & 0 deletions test/eulalie/test/creds.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,30 @@
(is (= 5 (expiry))))))))))


(defn amy-send []
(go (loop [n 5]
(println "Amy sends" n "to Brian")
(>! brian n)
(if (> n 0) (recur (dec n)) nil))))

(defn amy-receive []
(go-loop [_ nil]
(let [reply (<! brian)]
(println "Amy receives" reply "from Brian")
(if (> reply 0) (recur nil) (close! amy)))))

(defn activate [[from-str from-chan] [to-str to-chan] & [start-value]]
(go-loop [n (or start-value (<! from-chan))]
(println from-str "sends" n "to" to-str)
(println "BEFORE WRITE")
(>! to-chan n)
(println "AFTER WRITE, B4 READ")
(let [reply (<! from-chan)]
(println "AFTER READ")
(println from-str "gets" reply)
(if (pos? reply)
(recur (dec reply))
(do
(close! from-chan)
(close! to-chan)
(println "Finished" from-str))))))

0 comments on commit 9d154fa

Please sign in to comment.