DOC: point more explicitly to Config library docs
Am Donnerstag, 9. Februar 2012 10:04:03 UTC+1 schrieb Patrik Nordwall:
On Thu, Feb 9, 2012 at 9:54 AM, Michael Slinn <mslinn@gmail.com> wrote:
What I mean is, doesn't this merely overrides default values:
Yes, reference.conf are always used as fallback (default values).
val system = ActorSystem("actorSystem", ConfigFactory.parseString(configString))
If so, then I don't see the point of specifying a fallback like this:
val system = ActorSystem("actorSystem", ConfigFactory.parseString(configString).withFallback(ConfigFactory.load))
I think the point of that example was to load application.conf also.
So, to be completely explicit: ConfigFactory.load is normally done implicitly by the ActorSystem (unless passing your own Config in), but is not done implicitly by the ConfigFactory ;-)
but this might make sense:
val system = ActorSystem("actorSystem", ConfigFactory.parseFile("blah").withFallback(ConfigFactory.parseString(configString)))
That can be done, but that is a different thing than loading application.conf from classpath.
I think the JavaDoc of the config lib is awesome and all details are be explained there.
Yes, I’ll make sure that our docs point more aggressively in that direction (my remark earlier was targeted at our configuration.rst, which should mention how ConfigFactory.load() is triggered internally; will add that now).
On Thu, Feb 9, 2012 at 9:54 AM, Michael Slinn <mslinn@gmail.com> wrote:
What I mean is, doesn't this merely overrides default values:
Yes, reference.conf are always used as fallback (default values).
val system = ActorSystem("actorSystem", ConfigFactory.parseString(configString))
If so, then I don't see the point of specifying a fallback like this:
val system = ActorSystem("actorSystem", ConfigFactory.parseString(configString).withFallback(ConfigFactory.load))
I think the point of that example was to load application.conf also.
So, to be completely explicit: ConfigFactory.load is normally done implicitly by the ActorSystem (unless passing your own Config in), but is not done implicitly by the ConfigFactory ;-)
but this might make sense:
val system = ActorSystem("actorSystem", ConfigFactory.parseFile("blah").withFallback(ConfigFactory.parseString(configString)))
That can be done, but that is a different thing than loading application.conf from classpath.
I think the JavaDoc of the config lib is awesome and all details are be explained there.
Yes, I’ll make sure that our docs point more aggressively in that direction (my remark earlier was targeted at our configuration.rst, which should mention how ConfigFactory.load() is triggered internally; will add that now).
Leave a comment
on 2012-03-06 01:41 *
By rk@rkuhn.info
(In revision:56ce7a0ecd9107bdaef7be31ef18663f6829494f) rewrite configuration.rst, see #1823 and #1838
Branch: wip-config-docs-∂π
Branch: wip-config-docs-∂π
on 2012-03-06 09:29 *
By rk@rkuhn.info
(In revision:be50090d66e97072d1b66626c124ea47cb5a3a7f) rewrite configuration.rst, see #1823 and #1838
Branch: release-2.0
Branch: release-2.0