File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 71
71
{'manifold.go-off/<! `manifold.go-off/take!
72
72
:Return `return-deferred})
73
73
74
- (defmacro go-off-executor
74
+ (defmacro go-off-with
75
75
" Implementation of go-off that allows specifying executor. See docstring of go-off for usage."
76
76
[executor & body]
77
77
(let [executor (vary-meta executor assoc :tag 'java.util.concurrent.Executor)
118
118
- `deferred/chain` only works with single deferreds, which means having to write code in
119
119
unnatural ways to handle multiple deferreds."
120
120
[& body]
121
- `(go-off-executor (ex/execute-pool ) ~@body))
121
+ `(go-off-with (ex/execute-pool ) ~@body))
122
122
123
123
124
124
(comment
Original file line number Diff line number Diff line change 1
1
(ns manifold.go-off-test
2
2
(: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 ]]
4
4
[manifold.deferred :as d]
5
5
[manifold.test-utils :refer :all ]
6
6
[manifold.executor :as ex]
132
132
#(str prefix (swap! cnt inc))
133
133
(deliver (promise ) nil ))
134
134
: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)
136
136
" 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 )))
138
138
(finally (.shutdown custom-executor)))))
139
139
140
140
(deftest go-off-streams
You can’t perform that action at this time.
0 commit comments