aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/doc
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2014-02-07 11:11:00 +0100
committerJosé Valim <[email protected]>2014-02-11 14:21:52 +0100
commit8c049f556e2656598fcf1059efc20a64927f2d66 (patch)
tree56519ab291a4a5b5fc9efe3ea5492e301cec8a8d /lib/kernel/doc
parent25237481ccccd3ddfa74582dc267632ad618ba30 (diff)
downloadotp-8c049f556e2656598fcf1059efc20a64927f2d66.tar.gz
otp-8c049f556e2656598fcf1059efc20a64927f2d66.tar.bz2
otp-8c049f556e2656598fcf1059efc20a64927f2d66.zip
Allow persistent option on set_env/4 and unset_env/3
An environment key set with the persistent option will not be overridden by the ones configured in the application resource file on load. This means persistent values will stick after the application is loaded and also on application reload.
Diffstat (limited to 'lib/kernel/doc')
-rw-r--r--lib/kernel/doc/src/application.xml17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/kernel/doc/src/application.xml b/lib/kernel/doc/src/application.xml
index 3909b11e59..432dbb6984 100644
--- a/lib/kernel/doc/src/application.xml
+++ b/lib/kernel/doc/src/application.xml
@@ -239,10 +239,19 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
<desc>
<p>Sets the value of the configuration parameter <c><anno>Par</anno></c> for
<c><anno>Application</anno></c>.</p>
- <p><c>set_env/3</c> uses the standard <c>gen_server</c> timeout
- value (5000 ms). A <c><anno>Timeout</anno></c> argument can be provided
+ <p><c>set_env/4</c> uses the standard <c>gen_server</c> timeout
+ value (5000 ms). The <c>timeout</c> option can be provided
if another timeout value is useful, for example, in situations
where the application controller is heavily loaded.</p>
+ <p>If <c>set_env/4</c> is called before the application is loaded,
+ the application environment values specified in the <c>Application.app</c>
+ file will override the ones previously set. This is also true for application
+ reloads.</p>
+ <p>The <c>persistent</c> option can be set to <c>true</c>
+ when there is a need to guarantee parameters set with <c>set_env/4</c>
+ will not be overridden by the ones defined in the application resource
+ file on load. This means persistent values will stick after the application
+ is loaded and also on application reload.</p>
<warning>
<p>Use this function only if you know what you are doing,
that is, on your own applications. It is very application
@@ -406,9 +415,11 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
<p>Removes the configuration parameter <c><anno>Par</anno></c> and its value
for <c><anno>Application</anno></c>.</p>
<p><c>unset_env/2</c> uses the standard <c>gen_server</c>
- timeout value (5000 ms). A <c><anno>Timeout</anno></c> argument can be
+ timeout value (5000 ms). The <c>timeout</c> option can be
provided if another timeout value is useful, for example, in
situations where the application controller is heavily loaded.</p>
+ <p><c>unset_env/3</c> also allows the persistent option to be passed
+ (see <c>set_env/4</c> above).</p>
<warning>
<p>Use this function only if you know what you are doing,
that is, on your own applications. It is very application