forked from mbbx6spp/rebar-templates
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add finsup template for isolated supervisor
In cases where a supervisor is needed separate from a top-level application supervisor, the finsup template should be used.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
%%%' HEADER | ||
%%% @author {{author_name}} <{{author_email}}> | ||
%%% @since {{date}} | ||
%%% @copyright {{copyright_year}} {{author_name}} | ||
%%% @doc {{description}} | ||
%%% @end | ||
-module({{name}}_sup). | ||
|
||
-behaviour(supervisor). | ||
-export([start_link/0]). | ||
-export([init/1]). | ||
|
||
-define(SERVER, ?MODULE). | ||
%%%. | ||
%%%' PUBLIC API | ||
start_link() -> | ||
supervisor:start_link({local, ?SERVER}, ?MODULE, []). | ||
|
||
%%%. | ||
%%%' CALLBACKS | ||
init([]) -> | ||
{ok, { {one_for_one, 5, 10}, []} }. | ||
|
||
%%%. | ||
%%% vim: set filetype=erlang tabstop=2 foldmarker=%%%',%%%. foldmethod=marker: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{variables, [ | ||
{name, "supname"}, | ||
{app_dir, "."}, | ||
{copyright_year, "2011"}, | ||
{author_name, "Susan Potter"}, | ||
{author_email,"me@susanpotter.net"} | ||
]}. | ||
{dir, "{{app_dir}}/src"}. | ||
{template, "finsup.erl", "{{app_dir}}/src/{{name}}_sup.erl"}. |