Hi. I'm new here — just joined a company that's using mount. :-)
What's the recommended way to check whether a state is running?
I think I want something like (defstate foo :start ... :stop (when <running> ...))
in order to checks which states are running:
(mount/running-states)
will return a set of states that are currently running
but to your specific example, foo
is available as a known reference "at a :stop
function", so depending on what type foo is, you can do something like that:
(defstate server :start (start-server)
:stop (when server (.stop server)))