This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-13
Channels
- # aleph (15)
- # announcements (4)
- # babashka (36)
- # babashka-sci-dev (1)
- # beginners (15)
- # biff (2)
- # calva (15)
- # cider (3)
- # clj-kondo (8)
- # clojure (149)
- # clojure-europe (14)
- # clojure-norway (13)
- # clojure-switzerland (1)
- # clojure-uk (1)
- # clojurescript (21)
- # community-development (5)
- # cursive (20)
- # data-science (2)
- # datomic (7)
- # duct (5)
- # emacs (19)
- # etaoin (3)
- # events (2)
- # fulcro (11)
- # introduce-yourself (2)
- # jobs (4)
- # jobs-discuss (19)
- # joyride (1)
- # leiningen (11)
- # malli (7)
- # membrane (131)
- # nbb (12)
- # nginx (1)
- # off-topic (33)
- # pathom (8)
- # polylith (28)
- # re-frame (8)
- # sci (7)
- # shadow-cljs (225)
- # spacemacs (10)
- # specter (1)
- # vim (10)
- # xtdb (8)
@kevin.van.rooijen What a good place to manually save the state in an atom?
@kevin.van.rooijen Can you show me your code?
Sorry, I literally can't because I don't work for that company anymore and don't have access to the code 😅 But something along these lines:
(ns simple.main
(:gen-class)
(:require [duct.core :as duct]))
(defonce stored-config (atom nil))
(defonce stored-system (atom nil))
(duct/load-hierarchy)
(defn -main [& args]
(let [keys (or (duct/parse-keys args) [:duct/daemon])
profiles [:duct.profile/prod]
config (-> (duct/resource "simple/config.edn")
(duct/read-config)
(duct/prep-config profiles))
system (ig/init config keys)]
(reset! stored-config config)
(reset! stored-system system)
(duct/await-daemons system)))
I see. Thank you!