Skip to content

Commit

Permalink
Merge pull request #297 from the-mikedavis/md-start-cluster-1-docs
Browse files Browse the repository at this point in the history
Fix docs for `ra:start_cluster/1`
  • Loading branch information
michaelklishin authored Jul 4, 2022
2 parents 0e50ca9 + 22070f3 commit 485fb56
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/ra.erl
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,18 @@ start_cluster(System, ClusterName, Machine, ServerIds, Timeout)
end || Id <- ServerIds],
start_cluster(System, Configs, Timeout).

%% @doc Same as `start_cluster/2' but uses the default Ra system.
%% @param ServerConfigs a list of initial server configurations
%% DEPRECATED: use start_cluster/2
%% @end
-spec start_cluster([ra_server:ra_server_config()]) ->
{ok, [ra_server_id()], [ra_server_id()]} |
{error, cluster_not_formed}.
start_cluster(ServerConfigs) ->
start_cluster(default, ServerConfigs).

%% @doc Starts a new distributed ra cluster.
%%
%% @param System the system name
%% @param ServerConfigs a list of initial server configurations
%% @returns
%% `{ok, Started, NotStarted}' if a cluster could be successfully
Expand All @@ -375,20 +385,15 @@ start_cluster(System, ClusterName, Machine, ServerIds, Timeout)
%% If a cluster could not be formed any servers that did manage to start are
%% forcefully deleted.
%% @end
-spec start_cluster([ra_server:ra_server_config()]) ->
{ok, [ra_server_id()], [ra_server_id()]} |
{error, cluster_not_formed}.
start_cluster(ServerConfigs)
start_cluster(default, ServerConfigs).

-spec start_cluster(atom(), [ra_server:ra_server_config()]) ->
{ok, [ra_server_id()], [ra_server_id()]} |
{error, cluster_not_formed}.
start_cluster(System, ServerConfigs)
when is_atom(System) ->
start_cluster(System, ServerConfigs, ?START_TIMEOUT).

%% @doc Same as `start_cluster/1' but accepts a custom timeout.
%% @doc Same as `start_cluster/2' but accepts a custom timeout.
%% @param System the system name
%% @param ServerConfigs a list of initial server configurations
%% @param Timeout the timeout to use
%% @end
Expand Down

0 comments on commit 485fb56

Please sign in to comment.