Don't register name for pool_sup

This commit is contained in:
Feng Lee 2016-08-13 12:21:18 +08:00
parent d8aa7d9cfa
commit f166143cd0
1 changed files with 3 additions and 3 deletions

View File

@ -41,10 +41,10 @@ start_link(Pool, Type, MFA) ->
-spec(start_link(atom(), atom(), pos_integer(), mfa()) -> {ok, pid()} | {error, any()}). -spec(start_link(atom(), atom(), pos_integer(), mfa()) -> {ok, pid()} | {error, any()}).
start_link(Pool, Type, Size, MFA) -> start_link(Pool, Type, Size, MFA) ->
supervisor:start_link({local, sup_name(Pool)}, ?MODULE, [Pool, Type, Size, MFA]). supervisor:start_link(?MODULE, [Pool, Type, Size, MFA]).
sup_name(Pool) when is_atom(Pool) -> %% sup_name(Pool) when is_atom(Pool) ->
list_to_atom(atom_to_list(Pool) ++ "_pool_sup"). %% list_to_atom(atom_to_list(Pool) ++ "_pool_sup").
init([Pool, Type, Size, {M, F, Args}]) -> init([Pool, Type, Size, {M, F, Args}]) ->
ensure_pool(Pool, Type, [{size, Size}]), ensure_pool(Pool, Type, [{size, Size}]),