summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-05-08 23:37:33 +0200
committerHarald Welte <laforge@gnumonks.org>2012-05-08 23:37:33 +0200
commit09a80c09dfa4b7d6ba94b5bbd3825da02fd17aa5 (patch)
tree2f5574a121ef3447ac497d2af6cbd55a3f3277c3
parent7c3ec176b13b4011ae6f96c141a24dadad84a055 (diff)
sg_as_sup: introduc get_as_fsm_name/1
-rw-r--r--src/sg_as_sup.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sg_as_sup.erl b/src/sg_as_sup.erl
index ee5f06c..6a2f2f2 100644
--- a/src/sg_as_sup.erl
+++ b/src/sg_as_sup.erl
@@ -37,8 +37,10 @@
-export([init/1, start_link/2]).
+-export([get_as_fsm_name/1]).
+
init([Name, Options]) ->
- AsName = list_to_atom("sg_as_" ++ Name ++ "_fsm"),
+ AsName = get_as_fsm_name(Name),
StartArgs = [{local, AsName}, xua_as_fsm, [self()], Options],
StartFunc = {gen_fsm, start_link, StartArgs},
ChildSpec = {as_fsm, StartFunc, permanent, 4000, worker, [xua_as_fsm]},
@@ -50,3 +52,6 @@ init([Name, Options]) ->
start_link(Name, Options) ->
supervisor:start_link(?MODULE, [Name, Options]).
+
+get_as_fsm_name(Name) ->
+ list_to_atom("sg_as_" ++ Name ++ "_fsm").