summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-02-11 10:31:23 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-02-11 10:31:23 +0000
commit2164f0e8df6689aafab5fdc7d2179ad5bb7dc178 (patch)
tree997914a51fa4373193f5359fc89e7aaecae68efc /src
parentda37019095a31189136fa4232e28c95e8beaffe5 (diff)
downloadrabbitmq-server-git-2164f0e8df6689aafab5fdc7d2179ad5bb7dc178.tar.gz
More documentation, slightly stricter types.
Diffstat (limited to 'src')
-rw-r--r--src/mirrored_supervisor.erl15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl
index 6c5c09dfd8..f44b1f1d7e 100644
--- a/src/mirrored_supervisor.erl
+++ b/src/mirrored_supervisor.erl
@@ -70,6 +70,19 @@
%% application should invoke create_tables() (or table_definitions()
%% if it wants to manage table creation itself).
%%
+%% The TxFun parameter to start_link/{4,5} is a function which the
+%% mirrored supervisor can use to execute Mnesia transactions. In the
+%% RabbitMQ server this goes via a worker pool; in other cases a
+%% function like:
+%%
+%% tx_fun(Fun) ->
+%% case mnesia:sync_transaction(Fun) of
+%% {atomic, Result} -> Result;
+%% {aborted, Reason} -> throw({error, Reason})
+%% end.
+%%
+%% could be used.
+%%
%% Internals
%% ---------
%%
@@ -161,7 +174,7 @@
-type group_name() :: any().
--type(tx_fun() :: fun((fun(() -> any())) -> any())).
+-type(tx_fun() :: fun((fun(() -> A)) -> A)).
-spec start_link(GroupName, TxFun, Module, Args) -> startlink_ret() when
GroupName :: group_name(),