%%%------------------------------------------------------------------- %%% @author Heinz Nikolaus Gies %%% @copyright (C) 2013, Heinz Nikolaus Gies %%% @doc %%% %%% @end %%% Created : 30 Dec 2013 by Heinz Nikolaus Gies %%%------------------------------------------------------------------- -module(fifo_s3_download_sup). -behaviour(supervisor). %% API -export([start_child/7, start_link/0]). %% Supervisor callbacks -export([init/1]). -define(SERVER, ?MODULE). %%%=================================================================== %%% API functions %%%=================================================================== start_child(AKey, SKey, Host, Port, Bucket, Key, Opts) -> supervisor:start_child( ?SERVER, [AKey, SKey, Host, Port, Bucket, Key, Opts]). %%-------------------------------------------------------------------- %% @doc %% Starts the supervisor %% %% @spec start_link() -> {ok, Pid} | ignore | {error, Error} %% @end %%-------------------------------------------------------------------- start_link() -> supervisor:start_link({local, ?SERVER}, ?MODULE, []). %%%=================================================================== %%% Supervisor callbacks %%%=================================================================== %%-------------------------------------------------------------------- %% @private %% @doc %% Whenever a supervisor is started using supervisor:start_link/[2,3], %% this function is called by the new process to find out about %% restart strategy, maximum restart frequency and child %% specifications. %% %% @spec init(Args) -> {ok, {SupFlags, [ChildSpec]}} | %% ignore | %% {error, Reason} %% @end %%-------------------------------------------------------------------- init([]) -> Element = {fifo_s3_download, {fifo_s3_download, start_link, []}, transient, infinity, worker, [fifo_s3_download]}, Children = [Element], RestartStrategy = {simple_one_for_one, 5, 10}, {ok, {RestartStrategy, Children}}. %%%=================================================================== %%% Internal functions %%%===================================================================