Skip to content

Commit

Permalink
Merge pull request basho#430 from basho/bugfix/csm/bad-type-specifica…
Browse files Browse the repository at this point in the history
…tions

Fix bad type specifications.
  • Loading branch information
cmeiklejohn committed Dec 12, 2013
2 parents a725d33 + 09d68a9 commit ca73d1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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 @@ -50,7 +50,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 @@ -188,18 +189,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

0 comments on commit ca73d1a

Please sign in to comment.