%%% -------------------------------------------------------
%%% @author huangyongxing@yeah.net
%%% @doc
%%% 虚拟客户端工作进程worker的监控树
%%% @end
%%% -------------------------------------------------------
-module(cli_role_sup).

-behaviour(supervisor).

%% API
-export([start_link/0]).

%% Supervisor callbacks
-export([init/1]).

-include("common.hrl").

-define(SERVER, ?MODULE).

start_link() ->
    supervisor:start_link({local, ?SERVER}, ?MODULE, []).

init([]) ->
    ?INFO_TTY("Start supervisor [~w] ...", [?SERVER]),
    %% {RestartStrategy, MaxR, MaxT}, MaxT秒内超过MaxR次重启，即停止监控树和子进程
    RestartStrategy = {simple_one_for_one, 10, 10},
    Children = [
        {cli_role_proc, {cli_role_proc, start_link, []}, transient, 5000, worker, [cli_role_proc]}
    ],
    {ok, {RestartStrategy, Children}}.

