Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
target latest manifold, mark 0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ztellman committed Jan 21, 2015
1 parent 9b6f681 commit a2dc13e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Lamina is for describing and analyzing streams of data. It provides a rich set
Add the following to the `:dependencies` section of your `project.clj` file:

```clj
[lamina "0.5.4"]
[lamina "0.5.6"]
```

## Rationale
Expand Down
10 changes: 5 additions & 5 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(defproject lamina "0.5.5"
(defproject lamina "0.5.6"
:description "event-driven data structures for clojure"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/tools.logging "0.2.6"]
:dependencies [[org.clojure/tools.logging "0.3.1"]
[org.flatland/useful "0.11.1"]
[potemkin "0.3.8"]
[manifold "0.1.0-alpha3"]]
[potemkin "0.3.11"]
[manifold "0.1.0-beta8"]]
:exclusions [org.clojure/contrib
org.clojure/clojure-contrib]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.5.1"]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.7.0-alpha5"]
[criterium "0.4.2"]
[codox-md "0.2.0" :exclusions [org.clojure/clojure]]]}
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}}
Expand Down
18 changes: 9 additions & 9 deletions src/lamina/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[manifold
[stream :as s]
[deferred :as d]]
[manifold.stream.core :as manifold]
[lamina.time :as t]
[lamina.core.watch :as w]
[lamina.core.named :as n]
Expand Down Expand Up @@ -403,7 +404,7 @@

;;;

(s/def-source LaminaChannelSource
(manifold/def-source LaminaChannelSource
[ch]

(isSynchronous [_] false)
Expand All @@ -416,7 +417,7 @@
(close [_]
(close ch))

(take [this blocking? default-val]
(take [this default-val blocking?]
(let [d (d/->deferred
(p/run-pipeline
(read-channel* ch
Expand All @@ -432,7 +433,7 @@
@d
d)))

(take [this blocking? default-val timeout timeout-val]
(take [this default-val blocking? timeout timeout-val]
(let [d (d/->deferred
(p/run-pipeline
(read-channel* ch
Expand All @@ -450,7 +451,7 @@
@d
d))))

(s/def-sink LaminaChannelSink
(manifold/def-sink LaminaChannelSink
[ch]

(isSynchronous [_] false)
Expand All @@ -464,14 +465,13 @@
(close ch))

(put [this x blocking?]

(let [x (enqueue ch x)
x (cond
(r/async-promise? x)
(-> x
d/->deferred
(d/chain (fn [_] true))
(d/catch Throwable (fn [_] false)))
(d/chain (fn [x] true))
(d/catch (fn [_] false)))

(or
(identical? :lamina/closed! x)
Expand All @@ -488,13 +488,13 @@

(.put this x blocking?)))

(extend-protocol s/Sourceable
(extend-protocol manifold/Sourceable

lamina.core.channel.IChannel
(to-source [ch]
(->LaminaChannelSource ch)))

(extend-protocol s/Sinkable
(extend-protocol manifold/Sinkable

lamina.core.channel.IChannel
(to-sink [ch]
Expand Down
5 changes: 2 additions & 3 deletions test/lamina/test/manifold.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

(validate-put-take in out)

(let [c' (channel)
out (s/->source c')]
(let [c' (channel)]
(s/connect c c')
(validate-put-take in out))))
(validate-put-take in (s/->source c')))))

0 comments on commit a2dc13e

Please sign in to comment.