From 07228f915a2023171e3df2db45153f683f866088 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Tue, 11 Feb 2014 10:31:23 +0000 Subject: More documentation, slightly stricter types. --- src/mirrored_supervisor.erl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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(), -- cgit v1.2.1