Skip to content

Commit 1b3ccf2

Browse files
committed
Rename go-off-executor to go-off-with
Better matches existing future-with macro
1 parent 6290073 commit 1b3ccf2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/manifold/go_off.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
{'manifold.go-off/<! `manifold.go-off/take!
7272
:Return `return-deferred})
7373

74-
(defmacro go-off-executor
74+
(defmacro go-off-with
7575
"Implementation of go-off that allows specifying executor. See docstring of go-off for usage."
7676
[executor & body]
7777
(let [executor (vary-meta executor assoc :tag 'java.util.concurrent.Executor)
@@ -118,7 +118,7 @@
118118
- `deferred/chain` only works with single deferreds, which means having to write code in
119119
unnatural ways to handle multiple deferreds."
120120
[& body]
121-
`(go-off-executor (ex/execute-pool) ~@body))
121+
`(go-off-with (ex/execute-pool) ~@body))
122122

123123

124124
(comment

test/manifold/go_off_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(ns manifold.go-off-test
22
(:require [clojure.test :refer :all]
3-
[manifold.go-off :refer [go-off <!? go-off-executor]]
3+
[manifold.go-off :refer [go-off <!? go-off-with]]
44
[manifold.deferred :as d]
55
[manifold.test-utils :refer :all]
66
[manifold.executor :as ex]
@@ -132,9 +132,9 @@
132132
#(str prefix (swap! cnt inc))
133133
(deliver (promise) nil))
134134
:stats-callback (constantly nil)})]
135-
(try (is (str/starts-with? @(go-off-executor custom-executor (.getName (Thread/currentThread))) prefix)
135+
(try (is (str/starts-with? @(go-off-with custom-executor (.getName (Thread/currentThread))) prefix)
136136
"Running on custom executor, thread naming should be respected.")
137-
@(go-off-executor custom-executor (.getName (Thread/currentThread)))
137+
@(go-off-with custom-executor (.getName (Thread/currentThread)))
138138
(finally (.shutdown custom-executor)))))
139139

140140
(deftest go-off-streams

0 commit comments

Comments
 (0)