Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad type specifications. #430

Merged
merged 1 commit into from
Dec 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/riak_core_connection.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
%% the number of accepted connections to max_nb_cons().
%% custom := service must provide a strategy to the cluster manager for choosing nodes
%% UNSUPPORTED so far. Should we use a behaviour for the service module?
-type(max_nb_cons() :: non_neg_integer()).
-type(max_nb_cons() :: non_neg_integer() | undefined).
-type(client_scheduler_strategy() :: default | askme).
-type(service_scheduler_strategy() :: {round_robin, max_nb_cons()} | custom).

Expand Down
9 changes: 5 additions & 4 deletions src/riak_core_connection_mgr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
-define(SERVER, riak_core_connection_manager).
-define(MAX_LISTENERS, 100).

-type(counter() :: non_neg_integer()).
-type counter() :: non_neg_integer().
-type target() :: {atom(), term()}.

%% Connection manager strategy (per Jon M.)
%% when a connection request comes in,
Expand Down Expand Up @@ -187,18 +188,18 @@ apply_locator(Name, Strategy) ->
%% Supervision must be done by the calling process if desired. No supervision
%% is done here.
%%
-spec connect(Target :: string(), ClientSpec :: clientspec(), Strategy :: client_scheduler_strategy()) -> {'ok', reference()}.
-spec connect(Target :: target(), ClientSpec :: clientspec(), Strategy :: client_scheduler_strategy()) -> {'ok', reference()}.
connect(Target, ClientSpec, Strategy) ->
gen_server:call(?SERVER, {connect, Target, ClientSpec, Strategy}, infinity).

%% @doc same as connect(Target, ClientSpec, default).
%% @see connect/3
-spec connect(Target :: string(), ClientSpec :: clientspec()) -> {'ok', reference()}.
-spec connect(Target :: target(), ClientSpec :: clientspec()) -> {'ok', reference()}.
connect(Target, ClientSpec) ->
gen_server:call(?SERVER, {connect, Target, ClientSpec, default}, infinity).

%% @doc Disconnect from the remote side.
-spec disconnect(Target :: string()) -> 'ok'.
-spec disconnect(Target :: target()) -> 'ok'.
disconnect(Target) ->
gen_server:cast(?SERVER, {disconnect, Target}).

Expand Down