summaryrefslogtreecommitdiff
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
commit07228f915a2023171e3df2db45153f683f866088 (patch)
tree997914a51fa4373193f5359fc89e7aaecae68efc
parent35d03c54e2eaa15bd472d4a64638f467d5aff298 (diff)
downloadrabbitmq-server-bug26000.tar.gz
More documentation, slightly stricter types.bug26000
-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 6c5c09df..f44b1f1d 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(),