This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-25
Channels
- # admin-announcements (5)
- # arachne (1)
- # beginners (29)
- # boot (36)
- # cider (110)
- # clara (1)
- # cljs-dev (3)
- # cljs-edn (14)
- # cljsrn (24)
- # clojure (63)
- # clojure-belgium (3)
- # clojure-dusseldorf (5)
- # clojure-greece (9)
- # clojure-russia (142)
- # clojure-sg (15)
- # clojure-uk (20)
- # clojurebridge (4)
- # clojurescript (58)
- # data-science (1)
- # datomic (37)
- # editors (2)
- # editors-rus (7)
- # emacs (1)
- # garden (31)
- # hoplon (3)
- # jobs-discuss (8)
- # keechma (86)
- # leiningen (1)
- # liberator (2)
- # mount (23)
- # off-topic (2)
- # om (18)
- # onyx (42)
- # planck (1)
- # quil (6)
- # re-frame (8)
- # reagent (3)
- # ring-swagger (1)
- # specter (4)
- # untangled (1)
hey guys- I am a little confused from reading the documentation. lets say that in production I would like to restart a DB connection that is a mount state.
how do I do this? will calling (mount/stop #'app.db/conn) + (mount/start #'app.db/conn) do the job?
@dm3: no, it will just restart conn
with plugging its deps (i.e. config
) back in. but it won't follow the graph to restart other depending states. so if you refer to conn
as a var, you should be good. if you closed over this conn
, this would be stale.
that's what I expected wasn't sure it's not doing some magic like https://github.com/hoplon/javelin/blob/master/src/javelin/core.clj
no, mount just creates and lets go really. I generally restart things like web servers (or other things that are usually not plugged in anywhere) at runtime. to restart a db
connection would be something a bit more involved I would think (just from the use case perspective). but in case it is needed, something like:
(mount/stop #'foo/a #'bar/b #'baz/db)
(mount/start #'foo/a #'bar/b #'baz/db)
can be crafted to handle use cases like itwhere a
and b
had db
injected in their :start
and would need to be restarted along with db
@ido: when would you want to restart conn
at runtime? (just curious, maybe we can think of something to make it easier: i.e. suggest/log what could be effected if you restart a single state, or something along those lines)
@tolitius: sometimes hardware fails. since this a vast key-value cluster, I have no transactions to care about. When I have a faulty driver, sometimes this is a quick work-around. And you know how it is: the temporary of today is the legacy of tomorrow.
@tolitius: and since in this case the DB is stateless- restarting only this state is enough. I really need to rewrite couch-base driver in clojure. maybe we will open source it.