Skip to content

Commit e33f4a4

Browse files
committed
Revert "Use vthread pool instead of core.async pipeline-blocking"
This reverts commit 67c23ea.
1 parent 67c23ea commit e33f4a4

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/manetu/sparql_loadtest/core.clj

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[medley.core :as m]
66
[promesa.core :as p]
77
[taoensso.timbre :as log]
8-
[clojure.core.async :refer [<!! <! >!! go go-loop] :as async]
8+
[clojure.core.async :refer [<! go go-loop] :as async]
99
[progrock.core :as pr]
1010
[doric.core :refer [table]]
1111
[ring.util.codec :as ring.codec]
@@ -34,18 +34,9 @@
3434
:duration d)))))))
3535

3636
(defn- pipeline-blocking
37-
[nr f in]
37+
[nr xf in]
3838
(let [out (async/chan nr)]
39-
(-> (p/all
40-
(map (fn [_]
41-
(p/vthread
42-
(loop []
43-
(when-let [m (<!! in)]
44-
(>!! out (f m))
45-
(recur)))))
46-
(range nr)))
47-
(p/then (fn [_]
48-
(async/close! out))))
39+
(async/pipeline-blocking nr out xf in)
4940
out))
5041

5142
(defn async-xform
@@ -66,7 +57,7 @@
6657
(log/trace "launching with concurrency:" concurrency)
6758
(let [query (-> query slurp ring.codec/url-encode)]
6859
(->> (binding-loader/get-bindings bindings nr batch-size)
69-
(pipeline-blocking concurrency (partial execute-query ctx query))
60+
(pipeline-blocking concurrency (map (partial execute-query ctx query)))
7061
(async-xform (mapcat (fn [{:keys [success result] :as x}]
7162
(if (true? success)
7263
(map (fn [r] (assoc x :result r)) result)

0 commit comments

Comments
 (0)