This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-04
Channels
- # beginners (8)
- # boot (20)
- # cider (8)
- # cljs-dev (263)
- # cljsjs (8)
- # cljsrn (20)
- # clojure (151)
- # clojure-argentina (1)
- # clojure-belgium (7)
- # clojure-dev (18)
- # clojure-italy (25)
- # clojure-spec (34)
- # clojure-uk (15)
- # clojurescript (89)
- # component (45)
- # core-async (27)
- # cursive (16)
- # datomic (53)
- # emacs (40)
- # figwheel (3)
- # hoplon (62)
- # jobs (1)
- # jobs-discuss (7)
- # luminus (8)
- # lumo (60)
- # off-topic (3)
- # parinfer (1)
- # precept (1)
- # protorepl (15)
- # re-frame (37)
- # reagent (7)
- # ring (3)
- # ring-swagger (73)
- # slack-help (1)
- # specter (19)
- # sql (4)
- # test-check (10)
- # uncomplicate (2)
- # unrepl (14)
- # untangled (52)
- # vim (5)
- # yada (42)
can I stop/start a single component that's part of a larger system and expect it to propagate to the other components that depend on it?
each part of the system is meant to be immutable, which means restarting foo means restarting transitively everything that uses foo
Operations happen over the entire system. You can manually traverse the system with update-system
if you wish.
(but maybe you could get away with not restarting the things foo uses - maybe hack?)
You can also look at how things in component are implemented (see tools.namespace), and traverse the graph yourself.
But know that it's conceptually much more difficult to manage than just restarting the entire system.
The only downside I see there is speed. If for some reason cycling some particular component is slow, it might need to be avoided. But I have yet to have a system restart that takes longer than a second (and I have some pretty big systems).
cool. in this case i need to reset a released Datomic connection. other components in the system are the web server and an elasticsearch connection
You know what? I don't even release my datomic conns on system restart. I forgot that fn even existed.
Datomic is kind of a special animal IMO. It's inherently tied to the lifecycle of the VM (via agents).
the problem is sometimes during dev i need to recreate the database, which releases the connection
you can restart a system without restarting either jvm or repl
yeah, you can easily do that with the whole system
just stop it then start it
@potetm yep, but the connection stored in the db component will be released when i do that
I find that relationship awkward, especially considering datomic has its own resources it manages anyways.
I do have a datomic component in my system, but I have multiple databases, and must dispatch on a value other than the URI.
Or you create a component that wraps anything that uses a URI if you want to make the URI opaque.
So no need to take over something that Datomic has already agreed to do correctly. Just pass the dispatch value.