[#5]: suspendable example app.. [done]
This commit is contained in:
parent
9d7c5576f8
commit
d1ba7908bf
2 changed files with 7 additions and 2 deletions
|
|
@ -21,6 +21,7 @@
|
|||
(mount/start))
|
||||
|
||||
(defn stop []
|
||||
(mount/suspend)
|
||||
(mount/stop-except #'app.www/nyse-app))
|
||||
|
||||
(defn refresh []
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue