From 56094478dbe5398d6a8524e8bee5339ab814737e Mon Sep 17 00:00:00 2001 From: Sebastian Crane Date: Tue, 22 Mar 2022 22:24:31 +0000 Subject: [PATCH] Remove use of state container in main function Since the main function will only ever start and stop one system, this commit simplifies the main function to use a single lexical binding for the system state rather than creating an Atom. Signed-off-by: Sebastian Crane --- src/system.clj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/system.clj b/src/system.clj index e57f769..d675a26 100644 --- a/src/system.clj +++ b/src/system.clj @@ -62,7 +62,6 @@ (swap! system-atom start))) (defn -main [& args] - (let [main-system (atom (system/system))] - (swap! main-system system/start) + (let [main-system (system/start nil)] (.addShutdownHook (Runtime/getRuntime) - (Thread. (partial swap! main-system stop))))) + (Thread. #(stop main-system)))))