0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 13:10:24 +00:00

polished dialyzer warnings on supervisor init/1 specs

This commit is contained in:
Roberto Ostinelli 2012-02-20 21:25:19 -08:00
parent e7b6e2a402
commit f3de086980
3 changed files with 21 additions and 3 deletions

View file

@ -30,7 +30,13 @@ start_link(NbAcceptors, Transport, TransOpts,
%% supervisor.
-spec init(list()) -> {ok, {{one_for_one, 10, 10}, list()}}.
-spec init([any()]) -> {'ok', {{'one_for_one', 10, 10}, [{
any(), {atom() | tuple(), atom(), 'undefined' | [any()]},
'permanent' | 'temporary' | 'transient',
'brutal_kill' | 'infinity' | non_neg_integer(),
'supervisor' | 'worker',
'dynamic' | [atom() | tuple()]}]
}}.
init([NbAcceptors, Transport, TransOpts,
Protocol, ProtoOpts, ListenerPid, ReqsPid]) ->
{ok, LSocket} = Transport:listen(TransOpts),

View file

@ -32,7 +32,13 @@ start_request(ListenerPid, Socket, Transport, Protocol, Opts) ->
%% supervisor.
-spec init([]) -> {ok, {{simple_one_for_one, 0, 1}, [{_, _, _, _, _, _}, ...]}}.
-spec init([]) -> {'ok', {{'simple_one_for_one', 0, 1}, [{
any(), {atom() | tuple(), atom(), 'undefined' | [any()]},
'permanent' | 'temporary' | 'transient',
'brutal_kill' | 'infinity' | non_neg_integer(),
'supervisor' | 'worker',
'dynamic' | [atom() | tuple()]}]
}}.
init([]) ->
{ok, {{simple_one_for_one, 0, 1}, [{?MODULE, {?MODULE, start_request, []},
temporary, brutal_kill, worker, [?MODULE]}]}}.

View file

@ -29,7 +29,13 @@ start_link() ->
%% supervisor.
-spec init([]) -> {ok, {{one_for_one, 10, 10}, [{_, _, _, _, _, _}, ...]}}.
-spec init([]) -> {'ok', {{'one_for_one', 10, 10}, [{
any(), {atom() | tuple(), atom(), 'undefined' | [any()]},
'permanent' | 'temporary' | 'transient',
'brutal_kill' | 'infinity' | non_neg_integer(),
'supervisor' | 'worker',
'dynamic' | [atom() | tuple()]}]
}}.
init([]) ->
Procs = [{cowboy_clock, {cowboy_clock, start_link, []},
permanent, 5000, worker, [cowboy_clock]}],