Skip to content

Commit 9d15d5c

Browse files
authored
Merge pull request #212 from clj-commons/bugfix/wrong-realized-version
Wrong realized? version
2 parents 7eaf5bc + adc2af0 commit 9d15d5c

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ Manifold provides two core abstractions: **deferreds**, which represent a single
99

1010
A detailed discussion of Manifold's rationale can be found [here](doc/rationale.md). Full documentation can be found [here](https://cljdoc.org/d/manifold/manifold).
1111

12-
12+
Leiningen:
1313
```clojure
1414
[manifold "0.2.4"]
1515
```
1616

17+
deps.edn:
18+
```clojure
19+
manifold/manifold {:mvn/version "0.2.4"}
20+
```
21+
1722
### Deferreds
1823

1924
A deferred in Manifold is similar to a Clojure promise:

project.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:license {:name "MIT License"
44
:url "http://opensource.org/licenses/MIT"}
55
:url "https://github.com/clj-commons/manifold"
6-
:scm {:name "git" :url "https://github.com/KingMob/manifold"}
6+
:scm {:name "git" :url "https://github.com/clj-commons/manifold"}
77
:dependencies [[org.clojure/clojure "1.11.0" :scope "provided"]
88
[org.clojure/tools.logging "1.1.0" :exclusions [org.clojure/clojure]]
99
[io.aleph/dirigiste "1.0.0"]
@@ -24,4 +24,5 @@
2424
:jvm-opts ^:replace ["-server"
2525
"-XX:-OmitStackTraceInFastThrow"
2626
"-Xmx2g"
27-
"-XX:NewSize=1g"])
27+
"-XX:NewSize=1g"]
28+
:javac-options ["-target" "1.8" "-source" "1.8"])

src/manifold/stream.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@
574574
(let [d (if (closed? stream)
575575
(d/success-deferred false)
576576
(put! stream (f)))]
577-
(if (realized? d)
577+
(if (d/realized? d)
578578
(when-not @d
579579
(do
580580
(@cancel)

test/manifold/deferred_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
(testing "uniformly distributed"
303303
(let [results (atom {})
304304
;; within 10%
305-
n 1e4, r 10, eps (* n 0.1)
305+
n 1e4, r 10, eps (* n 0.15)
306306
f #(/ (% n eps) r)]
307307
(dotimes [_ n]
308308
@(d/chain (apply d/alt (range r))

test/manifold/stream_test.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,19 +307,19 @@
307307

308308
(let [a (s/put! s 9)
309309
b (s/put! s 2)]
310-
(is (realized? a))
310+
(is (d/realized? a))
311311
(is (= true @a))
312-
(is (not (realized? b)))
312+
(is (not (d/realized? b)))
313313
(is (= 9 @(s/take! s)))
314-
(is (realized? b))
314+
(is (d/realized? b))
315315
(is (= true @b))
316316
(let [c (s/put! s 12)
317317
d (s/put! s 1)]
318-
(is (not (or (realized? c) (realized? d))))
318+
(is (not (or (d/realized? c) (d/realized? d))))
319319
(is (= 2 @(s/take! s)))
320-
(is (not (or (realized? c) (realized? d))))
320+
(is (not (or (d/realized? c) (d/realized? d))))
321321
(is (= 12 @(s/take! s)))
322-
(is (realized? d))
322+
(is (d/realized? d))
323323
(is (= true @d))
324324
(is (= 1 @(s/take! s)))))))
325325

0 commit comments

Comments
 (0)