From d1ba7908bfaa5d293560452d73541cb9ae4963d5 Mon Sep 17 00:00:00 2001 From: anatoly Date: Sat, 21 Nov 2015 14:04:15 -0500 Subject: [PATCH] [#5]: suspendable example app.. [done] --- dev/dev.clj | 1 + test/app/www.clj | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dev/dev.clj b/dev/dev.clj index 7f8b0d3..76c58d1 100644 --- a/dev/dev.clj +++ b/dev/dev.clj @@ -21,6 +21,7 @@ (mount/start)) (defn stop [] + (mount/suspend) (mount/stop-except #'app.www/nyse-app)) (defn refresh [] diff --git a/test/app/www.clj b/test/app/www.clj index 14ffb4f..6b68953 100644 --- a/test/app/www.clj +++ b/test/app/www.clj @@ -27,10 +27,14 @@ (run-jetty {:join? false :port (:port www)}))) +(declare nyse-app) ;; in case it needs to be accessed in "resume-nyse" (helping out Clojure compiler) + (defn resume-nyse [conf] - ;; making decision to whether call start / do something ro resume / or just do nothing + ;; making decision to whether call start / do something / or resume / or just do nothing + ;; access to the current (previous/old) state is here just by its name "nyse-app" ;; ... - ) + (create-nyse-schema) + nyse-app) ;; returning an existing nyse-app, _so it can be stopped_, later on (defstate nyse-app :start (start-nyse app-config) :resume (resume-nyse app-config)