active_sup.erl 419 B

12345678910111213141516
  1. -module(active_sup).
  2. -behaviour(supervisor).
  3. -export([start_link/0]).
  4. -export([init/1]).
  5. -define(CHILD(I, Type, Args), {I, {I, start_link, Args}, permanent, 5000, Type, [I]}).
  6. start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []).
  7. init([]) ->
  8. {ok, {
  9. {one_for_one, 5, 10},
  10. [
  11. ?CHILD(active, worker, []),
  12. ?CHILD(active_events, worker, [])
  13. ]
  14. }}.