Current section

Files

Jump to
diint_utilites_common_app src diint_utilites_common_sup.erl
Raw

src/diint_utilites_common_sup.erl

-module(diint_utilites_common_sup).
-behaviour(supervisor).
-include("include/types_network.hrl").
-include_lib("kernel/include/logger.hrl").
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
%% ===================================================================
%% API functions
%% ===================================================================
start_link() ->
?LOG_INFO("start_link: ~w", [?MODULE]),
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
%% ===================================================================
%% Supervisor callbacks
%% ===================================================================
init([]) ->
?LOG_INFO("init: ~w", [?MODULE]),
DIINTStart = {diint_start_sup_sup,
{diint_start_sup, start_link, []},
permanent, 2000, supervisor,
[]},
Test = {test_wrk,
{test, start_link, []},
permanent, 2000, worker,
[]},
{ok, {{one_for_one, 5, 10}, [ DIINTStart, Test]}}.