Skip to content

Commit 0a02dbc

Browse files
Upgrade to core.async 1.6.673
Some of the functions that we were relying on to hijack the go state machine compilation changed namespaces. This updates the code to reference where they now live. Addresses #229
1 parent abc37c4 commit 0a02dbc

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[org.clojure/tools.logging "1.2.4" :exclusions [org.clojure/clojure]]
99
[org.clj-commons/dirigiste "1.0.3"]
1010
[riddley "0.2.0"]
11-
[org.clojure/core.async "1.5.648" :scope "provided"]
11+
[org.clojure/core.async "1.6.673" :scope "provided"]
1212
[potemkin "0.4.6"]]
1313
:profiles {:dev {:dependencies [[criterium "0.4.6"]]}}
1414
:test-selectors {:default #(not

src/manifold/go_off.clj

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
[executor :as ex]
77
[deferred :as d]]
88
[clojure.core.async.impl
9+
[runtime :as async-runtime]
910
[ioc-macros :as ioc]]
1011
[manifold.stream :as s])
1112
(:import (manifold.stream.core IEventSource)))
1213

1314
(defn ^:no-doc return-deferred [state value]
14-
(let [d (ioc/aget-object state ioc/USER-START-IDX)]
15+
(let [d (async-runtime/aget-object state async-runtime/USER-START-IDX)]
1516
(d/success! d value)
1617
d))
1718

@@ -38,28 +39,28 @@
3839
r#)))
3940

4041
(defn ^:no-doc run-state-machine-wrapped [state]
41-
(try (ioc/run-state-machine state)
42+
(try (async-runtime/run-state-machine state)
4243
(catch Throwable ex
43-
(d/error! (ioc/aget-object state ioc/USER-START-IDX) ex)
44+
(d/error! (async-runtime/aget-object state async-runtime/USER-START-IDX) ex)
4445
(throw ex))))
4546

4647
(defn ^:no-doc take! [state blk d]
4748
(let [handler (fn [x]
48-
(ioc/aset-all! state ioc/VALUE-IDX x ioc/STATE-IDX blk)
49+
(async-runtime/aset-all! state async-runtime/VALUE-IDX x async-runtime/STATE-IDX blk)
4950
(run-state-machine-wrapped state))
5051
;; if `d` is a stream, use `take` to get a deferrable that we can wait on
5152
d (if (instance? IEventSource d) (s/take! d) d)
5253
d-is-deferrable? (d/deferrable? d)]
5354
(if
5455
;; if d is not deferrable immediately resume processing state machine
5556
(not d-is-deferrable?)
56-
(do (ioc/aset-all! state ioc/VALUE-IDX d ioc/STATE-IDX blk)
57+
(do (async-runtime/aset-all! state async-runtime/VALUE-IDX d async-runtime/STATE-IDX blk)
5758
:recur)
5859
(let [d (d/->deferred d)]
5960
(if
6061
;; if already realized, deref value and immediately resume processing state machine
6162
(d/realized? d)
62-
(do (ioc/aset-all! state ioc/VALUE-IDX @d ioc/STATE-IDX blk)
63+
(do (async-runtime/aset-all! state async-runtime/VALUE-IDX @d async-runtime/STATE-IDX blk)
6364
:recur)
6465

6566
;; resume processing state machine once d has been realized
@@ -84,8 +85,8 @@
8485
(let [~@(mapcat (fn [[l sym]] [sym `(^:once fn* [] ~(vary-meta l dissoc :tag))]) crossing-env)
8586
f# ~(ioc/state-machine `(do ~@body) 1 [crossing-env &env] async-custom-terminators)
8687
state# (-> (f#)
87-
(ioc/aset-all! ioc/USER-START-IDX d#
88-
ioc/BINDINGS-IDX captured-bindings#))]
88+
(async-runtime/aset-all! async-runtime/USER-START-IDX d#
89+
async-runtime/BINDINGS-IDX captured-bindings#))]
8990
(run-state-machine-wrapped state#))))
9091
;; chain is8 being used to apply unwrap chain
9192
(d/chain d#)))

0 commit comments

Comments
 (0)