Permalink
Browse files

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...
mbbx6spp committed Feb 15, 2011
1 parent 6c622c0 commit 27fb5b10f028608a43b529232022965609f8671e
Showing with 34 additions and 0 deletions.
  1. +25 −0 finsup.erl
  2. +9 −0 finsup.template
View
@@ -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:
View
@@ -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"}.

0 comments on commit 27fb5b1

Please sign in to comment.