|
1 |
| -(ns com.stuartsierra.component |
2 |
| - (:require [com.stuartsierra.dependency :as dep])) |
| 1 | +(ns quile.component |
| 2 | + (:require [quile.dependency :as dep])) |
3 | 3 |
|
4 | 4 | (defprotocol Lifecycle
|
5 | 5 | (start [component]
|
|
66 | 66 |
|
67 | 67 | (defn dependency-graph
|
68 | 68 | "Returns a dependency graph, using the data structures defined in
|
69 |
| - com.stuartsierra.dependency, for the components found by |
| 69 | + quile.dependency, for the components found by |
70 | 70 | (select-keys system component-keys)"
|
71 | 71 | [system component-keys]
|
72 | 72 | (reduce-kv (fn [graph key component]
|
|
155 | 155 | ([system]
|
156 | 156 | (start-system system (keys system)))
|
157 | 157 | ([system component-keys]
|
158 |
| - (update-system system component-keys #+clj #'start #+cljs (aget com.stuartsierra.component "start")))) |
| 158 | + (update-system system component-keys #+clj #'start #+cljs (aget quile.component "start")))) |
159 | 159 |
|
160 | 160 | (defn stop-system
|
161 | 161 | "Recursively stops components in the system, in reverse dependency
|
|
165 | 165 | ([system]
|
166 | 166 | (stop-system system (keys system)))
|
167 | 167 | ([system component-keys]
|
168 |
| - (update-system-reverse system component-keys #+clj #'stop #+cljs (aget com.stuartsierra.component "stop")))) |
| 168 | + (update-system-reverse system component-keys #+clj #'stop #+cljs (aget quile.component "stop")))) |
169 | 169 |
|
170 | 170 | (defrecord SystemMap []
|
171 | 171 | Lifecycle
|
|
188 | 188 | with large objects. As a consequence, printed system maps cannot be
|
189 | 189 | 'read'. To disable this behavior and print system maps like normal
|
190 | 190 | records, call
|
191 |
| - (remove-method clojure.core/print-method com.stuartsierra.component.SystemMap)" |
| 191 | + (remove-method clojure.core/print-method quile.component.SystemMap)" |
192 | 192 | [& keyvals]
|
193 | 193 | ;; array-map doesn't check argument length (CLJ-1319)
|
194 | 194 | (when-not (even? (count keyvals))
|
|
198 | 198 |
|
199 | 199 | (defn ex-component?
|
200 | 200 | "True if the java.lang.Throwable has ex-data indicating it was
|
201 |
| - thrown by something in the com.stuartsierra.component namespace." |
| 201 | + thrown by something in the quile.component namespace." |
202 | 202 | [throwable]
|
203 | 203 | (let [{:keys [reason]} (ex-data throwable)]
|
204 | 204 | (and (keyword? reason)
|
205 |
| - (= "com.stuartsierra.component" |
| 205 | + (= "quile.component" |
206 | 206 | (namespace reason)))))
|
207 | 207 |
|
208 | 208 | (defn ex-without-components
|
209 | 209 | "If the java.lang.Throwable has ex-data provided by the
|
210 |
| - com.stuartsierra.component namespace, returns a new exception |
| 210 | + quile.component namespace, returns a new exception |
211 | 211 | instance with the :component and :system removed from its ex-data.
|
212 | 212 | Preserves the message, cause, and stacktrace of the original
|
213 | 213 | throwable. If the throwable was not created by this namespace,
|
|
0 commit comments