Merge with EMQ X project
This commit is contained in:
parent
4b8cd18f5d
commit
735211fd02
|
@ -36,17 +36,14 @@
|
||||||
start_link() ->
|
start_link() ->
|
||||||
supervisor:start_link({local, ?SUPERVISOR}, ?MODULE, []).
|
supervisor:start_link({local, ?SUPERVISOR}, ?MODULE, []).
|
||||||
|
|
||||||
-spec(start_child(atom(), worker | supervisor) -> startchild_ret()).
|
|
||||||
start_child(Mod, Type) when Type == worker orelse Type == supervisor ->
|
|
||||||
start_child(?CHILD(Mod, Type)).
|
|
||||||
|
|
||||||
-spec(start_child(supervisor:child_spec()) -> startchild_ret()).
|
-spec(start_child(supervisor:child_spec()) -> startchild_ret()).
|
||||||
start_child(ChildSpec) when is_tuple(ChildSpec) ->
|
start_child(ChildSpec) when is_tuple(ChildSpec) ->
|
||||||
supervisor:start_child(?SUPERVISOR, ChildSpec).
|
supervisor:start_child(?SUPERVISOR, ChildSpec).
|
||||||
|
|
||||||
-spec(start_child(Mod::atom(), Type :: worker | supervisor) -> {ok, pid()}).
|
-spec(start_child(atom(), worker | supervisor) -> startchild_ret()).
|
||||||
start_child(Mod, Type) when is_atom(Mod) and is_atom(Type) ->
|
start_child(Mod, Type) when Type == worker orelse Type == supervisor ->
|
||||||
supervisor:start_child(?MODULE, ?CHILD(Mod, Type)).
|
start_child(?CHILD(Mod, Type)).
|
||||||
|
|
||||||
-spec(stop_child(supervisor:child_id()) -> ok | {error, any()}).
|
-spec(stop_child(supervisor:child_id()) -> ok | {error, any()}).
|
||||||
stop_child(ChildId) ->
|
stop_child(ChildId) ->
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
-author("Feng Lee <feng@emqtt.io>").
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-include("emqx_protocol.hrl").
|
-include("emqx_mqtt.hrl").
|
||||||
|
|
||||||
-import(proplists, [get_value/3]).
|
-import(proplists, [get_value/3]).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue