Skip to content

Commit ef9038a

Browse files
Support both newer & older versions of core.async for go-off
1 parent 0a02dbc commit ef9038a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ jobs:
4040

4141
# run tests!
4242
- run: lein do clean, test
43+
- run: lein with-profile +older-core-async do clean, test manifold.go-off-test

project.clj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
[riddley "0.2.0"]
1111
[org.clojure/core.async "1.6.673" :scope "provided"]
1212
[potemkin "0.4.6"]]
13-
:profiles {:dev {:dependencies [[criterium "0.4.6"]]}}
13+
:profiles {:dev {:dependencies [[criterium "0.4.6"]]}
14+
;; core.async moved around some internal functions go-off relies on; this profile
15+
;; helps test that go-off still works both with the new namespaces and the old
16+
:older-core-async {:dependencies [[org.clojure/core.async "1.5.648" :scope "provided"]]}}
1417
:test-selectors {:default #(not
1518
(some #{:benchmark :stress}
1619
(cons (:tag %) (keys %))))

src/manifold/go_off.clj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
[executor :as ex]
77
[deferred :as d]]
88
[clojure.core.async.impl
9-
[runtime :as async-runtime]
109
[ioc-macros :as ioc]]
1110
[manifold.stream :as s])
1211
(:import (manifold.stream.core IEventSource)))
1312

13+
;; a number of functions from `ioc-macros` moved to `runtime` in org.clojure/core.async "1.6.673"
14+
;; since they were just moved without functionality changes, continue to support both via dynamic import
15+
(if (find-ns 'clojure.core.async.impl.runtime)
16+
(require '[clojure.core.async.impl.runtime :as async-runtime])
17+
(require '[clojure.core.async.impl.ioc-macros :as async-runtime]))
18+
1419
(defn ^:no-doc return-deferred [state value]
1520
(let [d (async-runtime/aget-object state async-runtime/USER-START-IDX)]
1621
(d/success! d value)

0 commit comments

Comments
 (0)