From 8c049f556e2656598fcf1059efc20a64927f2d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 7 Feb 2014 11:11:00 +0100 Subject: 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. --- lib/kernel/doc/src/application.xml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/kernel/doc') 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}]

Sets the value of the configuration parameter Par for Application.

-

set_env/3 uses the standard gen_server timeout - value (5000 ms). A Timeout argument can be provided +

set_env/4 uses the standard gen_server timeout + value (5000 ms). The timeout option can be provided if another timeout value is useful, for example, in situations where the application controller is heavily loaded.

+

If set_env/4 is called before the application is loaded, + the application environment values specified in the Application.app + file will override the ones previously set. This is also true for application + reloads.

+

The persistent option can be set to true + when there is a need to guarantee parameters set with set_env/4 + 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.

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}]

Removes the configuration parameter Par and its value for Application.

unset_env/2 uses the standard gen_server - timeout value (5000 ms). A Timeout argument can be + timeout value (5000 ms). The timeout option can be provided if another timeout value is useful, for example, in situations where the application controller is heavily loaded.

+

unset_env/3 also allows the persistent option to be passed + (see set_env/4 above).

Use this function only if you know what you are doing, that is, on your own applications. It is very application -- cgit v1.2.3