Re: How to handle configuration in Clojure?

2014-01-17 Thread Malcolm Sparks
There's also Jig : https://github.com/juxt/jig Jig's recommendation is for configuration to be held in EDN files. I much prefer EDN over environment variables. Environment variables feel awkward when there you have lots of configuration, usually in the form of a tree. Usually it makes sense

Re: How to handle configuration in Clojure?

2014-01-17 Thread Curtis Gagliardi
I've been using carica (https://github.com/sonian/carica) and have config map like {:dev ... :prod ...} and just using a single environmental variable to determine which of those config maps to use. On Friday, January 17, 2014 5:06:31 AM UTC-8, Malcolm Sparks wrote: There's also Jig :

Re: How to handle configuration in Clojure?

2014-01-14 Thread James Trunk
Thanks for all the great links and ideas you have all posted, now I have plenty of reading and thinking to do! I am curious about what you mean by 'thread safety'. Perhaps thread safety is the wrong term, but what I meant was the limitations dynamic binding introduces around thread

Re: How to handle configuration in Clojure?

2014-01-14 Thread Stefan Kanev
On 14/01/14, James Trunk wrote: I am curious about what you mean by 'thread safety'. Perhaps thread safety is the wrong term, but what I meant was the limitations dynamic binding introduces around thread dispatching, which Stuart Sierra explains in this blog

How to handle configuration in Clojure?

2014-01-13 Thread James Trunk
I've been investigating how to handle configuration in a Clojure application/library, and have discovered two main candidates: dynamics vars and argument passing. The downsides to dynamic vars seem to be: hiddenness, thread safety, and more complex tests (binding before each test). The

Re: How to handle configuration in Clojure?

2014-01-13 Thread Josh Smith
On Monday, January 13, 2014 8:50:54 AM UTC-5, James Trunk wrote: I've been investigating how to handle configuration in a Clojure application/library, and have discovered two main candidates: dynamics vars and argument passing. I would suggest you add Environment variables to your list.

Re: How to handle configuration in Clojure?

2014-01-13 Thread Josh Glover
On 13 January 2014 14:50, James Trunk james.tr...@gmail.com wrote: What is the current best practice for handling configuration? While I haven't tried this myself, this popped up on Planet Clojure a couple of days back: http://tech.puredanger.com/2014/01/03/clojure-dependency-injection/

Re: How to handle configuration in Clojure?

2014-01-13 Thread Joachim De Beule
There's also this: https://github.com/clojure-cookbook/clojure-cookbook/blob/master/local-io/edn-config/edn-config.asciidoc Joachim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com

Re: How to handle configuration in Clojure?

2014-01-13 Thread Andrey Antukh
https://github.com/james-henderson/nomad can be one option for manage/store a configuration ;) (it uses edn...) Andrey 2014/1/13 Joachim De Beule joachim.de.be...@gmail.com There's also this:

Re: How to handle configuration in Clojure?

2014-01-13 Thread Travis Vachon
Another option is to use leiningen profiles to change the classpath, loading different versions of a (eg) config.clj file in different environments. This lets you `require` the config namespace and refer to config parameters like `config/the-configured-value` Travis On Mon, Jan 13, 2014 at 11:05

Re: How to handle configuration in Clojure?

2014-01-13 Thread Kristoffer Skjutare
This got me thinking about Stuart Sierras Component: https://github.com/stuartsierra/component Kristoffer Den måndagen den 13:e januari 2014 kl. 16:22:55 UTC+1 skrev Joachim De Beule: There's also this:

Re: How to handle configuration in Clojure?

2014-01-13 Thread Stefan Kanev
On 13/01/14, James Trunk wrote: The downsides to dynamic vars seem to be: hiddenness, thread safety, and more complex tests (binding before each test). I am curious about what you mean by 'thread safety'. As far as I know, dynamic variables are thread-local, which means that they are

Re: How to handle configuration in Clojure?

2014-01-13 Thread Jonah Benton
A middle ground between dynamic vars and passing state through functions that themselves don't need it, but which is needed by functions they call, is to build on top of defprotocol and defrecord, to refactor so that the functions that need configuration state in their operations are defined by

Re: How to handle configuration in Clojure?

2014-01-13 Thread Christopher Allen
github.com/weavejester/environ/ + environment variables. 12-factor it that way, proxy the environment variables via a config namespace so that configuration values are programmatically generated in case something needs to intervene. On Monday, January 13, 2014 5:50:54 AM UTC-8, James Trunk

Re: How to handle configuration in Clojure?

2014-01-13 Thread Christopher Allen
Example here: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/config.clj On Monday, January 13, 2014 1:57:06 PM UTC-8, Christopher Allen wrote: github.com/weavejester/environ/ + environment variables. 12-factor it that way, proxy the environment variables via

Re: How to handle configuration in Clojure?

2014-01-13 Thread Mark Mandel
+1 for environ as well. I also have combined that with the Stuart Sierra reloaded workflow (started it before Components, don't know if I want to switch). http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded Finding it a great fit, as it's easy to switch out environ variables in