File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 123
123
124
124
[d debounce MSEC long " The time to wait (millisec) for filesystem to settle down." ]
125
125
126
- (. require @pod/worker-pod ( into-array String [ " boot.watcher" ]) )
126
+ (pod/ require-in-pod @pod/worker-pod " boot.watcher" )
127
127
(let [q (LinkedBlockingQueue. )
128
128
srcdirs (->> (core/get-env :src-paths ) (remove core/tmpfile?))
129
129
watchers (map file/make-watcher srcdirs)
Original file line number Diff line number Diff line change 134
134
out (io/output-stream (doto (io/file out-path) io/make-parents))]
135
135
(io/copy in out)))
136
136
137
- (def pod-id (atom nil ))
138
- (def worker-pod (atom nil ))
139
- (def shutdown-hooks (atom nil ))
137
+ (def pod-id (atom nil ))
138
+ (def worker-pod (atom nil ))
139
+ (def shutdown-hooks (atom nil ))
140
+
141
+ (defn set-worker-pod!
142
+ [pod]
143
+ (reset! worker-pod pod))
140
144
141
145
(defn add-shutdown-hook!
142
146
[f]
177
181
[& body]
178
182
`(eval-in @worker-pod ~@body))
179
183
184
+ (defn require-in-pod
185
+ [pod ns ]
186
+ (doto pod (.require (into-array String [(str ns )]))))
187
+
180
188
(defn resolve-dependencies
181
189
[env]
182
190
(call-worker `(boot.aether/resolve-dependencies ~env)))
227
235
(map (fn [[k v]] [v (.getPath (io/file outdir k))])))]
228
236
(doseq [[url-str out-path] ents] (copy-url url-str out-path))))
229
237
238
+ (defn- set-this-worker-in-pod!
239
+ [pod]
240
+ (doto pod
241
+ (require-in-pod " boot.pod" )
242
+ (.invoke " boot.pod/set-worker-pod!" @worker-pod)))
243
+
230
244
(defn make-pod
231
- ([] (boot.App/newPod ))
245
+ ([] (set-this-worker-in-pod! ( boot.App/newPod ) ))
232
246
([{:keys [src-paths] :as env}]
233
247
(let [dirs (map io/file src-paths)
234
248
jars (resolve-dependency-jars env)]
235
- (->> (concat dirs jars) (into-array java.io.File) (boot.App/newPod )))))
249
+ (set-this-worker-in-pod!
250
+ (->> (concat dirs jars) (into-array java.io.File) (boot.App/newPod ))))))
You can’t perform that action at this time.
0 commit comments