pooler_starter_sup.erl 719 B

1234567891011121314151617181920212223242526
  1. %% @doc Simple one for one supervisor for pooler_starter.
  2. %%
  3. %% This supervisor is shared by all pools since pooler_starter is a
  4. %% generic helper to fasciliate async member start.
  5. -module(pooler_starter_sup).
  6. -behaviour(supervisor).
  7. -export([new_starter/2,
  8. start_link/0,
  9. init/1]).
  10. -include("pooler.hrl").
  11. new_starter(Pool, Parent) ->
  12. supervisor:start_child(?MODULE, [Pool, Parent]).
  13. start_link() ->
  14. supervisor:start_link({local, ?MODULE}, ?MODULE, []).
  15. init([]) ->
  16. Worker = {pooler_starter, {pooler_starter, start_link, []},
  17. temporary, brutal_kill, worker, [pooler_starter]},
  18. Specs = [Worker],
  19. Restart = {simple_one_for_one, 1, 1},
  20. {ok, {Restart, Specs}}.