Permalink
Browse files

documented the mnesia option for set_env

  • Loading branch information...
1 parent 2a5aed4 commit 2dc8391a3f334ba0622ec960d7ae70895eea0904 Ulf Wiger committed Apr 26, 2011
Showing with 18 additions and 5 deletions.
  1. +12 −5 doc/gproc.md
  2. +6 −0 src/gproc.erl
View
@@ -940,18 +940,25 @@ property), Msg will be send to all processes that have such an object.<a name="s
<pre>set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Value::term(), Strategy) -> Value</pre>
-<ul class="definitions"><li><pre>Strategy = [Alternative]</pre></li><li><pre>Alternative = app_env | os_env | {os_env, VAR}</pre></li></ul>
+<ul class="definitions"><li><pre>Strategy = [Alternative]</pre></li><li><pre>Alternative = app_env | os_env | {os_env, VAR} | {mnesia, ActivityType, Oid, Pos}</pre></li></ul>
Updates the cached value as well as underlying environment.
-This function should be exercised with caution, as it affects the larger
-environment outside gproc. This function modifies the cached value, and then
-proceeds to update the underlying environment (OS environment variable or
-application environment variable).<a name="set_value-2"></a>
+
+
+This function should be exercised with caution, as it affects the larger
+environment outside gproc. This function modifies the cached value, and then
+proceeds to update the underlying environment (OS environment variable or
+application environment variable).
+
+When the `mnesia` alternative is used, gproc will try to update any existing
+object, changing only the `Pos` position. If no such object exists, it will
+create a new object, setting any other attributes (except `Pos` and the key)
+to `undefined`.<a name="set_value-2"></a>
<h3>set_value/2</h3>
View
@@ -354,13 +354,19 @@ do_get_env(Context, App, Key, Alternatives, Set) ->
%% Key::atom(), Value::term(), Strategy) -> Value
%% Strategy = [Alternative]
%% Alternative = app_env | os_env | {os_env, VAR}
+%% | {mnesia, ActivityType, Oid, Pos}
%%
%% @doc Updates the cached value as well as underlying environment.
%%
%% This function should be exercised with caution, as it affects the larger
%% environment outside gproc. This function modifies the cached value, and then
%% proceeds to update the underlying environment (OS environment variable or
%% application environment variable).
+%%
+%% When the `mnesia' alternative is used, gproc will try to update any existing
+%% object, changing only the `Pos' position. If no such object exists, it will
+%% create a new object, setting any other attributes (except `Pos' and the key)
+%% to `undefined'.
%% @end
%%
set_env(Scope, App, Key, Value, Strategy)

0 comments on commit 2dc8391

Please sign in to comment.