works as of old
[otp-base.git] / tools / .appgen / blank_app / src / ba_sup.erl
blobb5f48d11de1e0fa6990648f719f02933c9ba9b48
1 %%%-------------------------------------------------------------------
2 %%% @doc
3 %%% @end
4 %%%-------------------------------------------------------------------
5 -module(%%PFX%%_sup).
7 -behaviour(supervisor).
8 %%--------------------------------------------------------------------
9 %% Include files
10 %%--------------------------------------------------------------------
12 %%--------------------------------------------------------------------
13 %% External exports
14 %%--------------------------------------------------------------------
15 -export([
16 start_link/1
17 ]).
19 %%--------------------------------------------------------------------
20 %% Internal exports
21 %%--------------------------------------------------------------------
22 -export([
23 init/1
24 ]).
26 %%--------------------------------------------------------------------
27 %% Macros
28 %%--------------------------------------------------------------------
29 -define(SERVER, ?MODULE).
31 %%--------------------------------------------------------------------
32 %% Records
33 %%--------------------------------------------------------------------
35 %%====================================================================
36 %% External functions
37 %%====================================================================
38 %%--------------------------------------------------------------------
39 %% @doc Starts the supervisor.
40 %% @spec start_link(StartArgs) -> {ok, pid()} | Error
41 %% @end
42 %%--------------------------------------------------------------------
43 start_link(StartArgs) ->
44 supervisor:start_link({local, ?SERVER}, ?MODULE, []).
46 %%====================================================================
47 %% Server functions
48 %%====================================================================
49 %%--------------------------------------------------------------------
50 %% Func: init/1
51 %% Returns: {ok, {SupFlags, [ChildSpec]}} |
52 %% ignore |
53 %% {error, Reason}
54 %%--------------------------------------------------------------------
55 init([]) ->
56 RestartStrategy = one_for_one,
57 MaxRestarts = 1000,
58 MaxTimeBetRestarts = 3600,
60 SupFlags = {RestartStrategy, MaxRestarts, MaxTimeBetRestarts},
62 ChildSpecs =
64 {%%PFX%%_server,
65 {%%PFX%%_server, start_link, []},
66 permanent,
67 1000,
68 worker,
69 [%%PFX%%_server]}
71 {ok,{SupFlags, ChildSpecs}}.
72 %%====================================================================
73 %% Internal functions
74 %%====================================================================