Fork me on GitHub
#juxt
<
2024-03-09
>
cl_j01:03:07

When using clip, is it a good idea to extract the config and use it outside the component system? This could save some trouble of passing the parameters around.

(defonce (delay (lazy-loaded-config (read-config (io/resource "config.edn"))))

;; use lazy-loaded-config in other namespaces.

(defn -main []
  (let [system-config @lazy-loaded-config]
    (clip/start system-config)
    @(promise)))

jasonjckn05:03:38

very reminiscent of a program that has a lot of global variables.. usually not a great idea.

jasonjckn05:03:07

by keeping a system self contained, you could spin up multiple in parallel when running unit tests.

🙏 1