I need a supervisor who can start two kinds of childen.
the first is a supervisor child, like the supervisor, can i start a child with the same module like the supervisor?
For Example:
-module(test_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local,?MODULE}, ?MODULE, []).
init(_Args) ->
RestartStrategy = {one_for_one, 10, 60},
{ok, {RestartStrategy,
[{sup,
{sup, start_link, []},
permanent, infinity, supervisor, [sup]},
]}}.
in the supervisor module i init a child with the same module, is it possible?
the second kind of child is a normal worker, with a own module, this is not the problem. But can i starts dynamic this two different kinds in the supervisor module?