Permalink
Browse files

Bugs now fixed in finsrv Rebar template.

Fixed:
* Renamed argument Reason to _Reason to remove compilation warning.
* Now using ?SERVER instead of ?MODULE in stop/0 to be consistent with start/0
start_link/0.
* Added start/0 to enable easier testing of gen_server.
  • Loading branch information...
1 parent 44bb25c commit be024ce6f63d374f4692e50d5b25df3d24028b83 @mbbx6spp committed Feb 7, 2011
Showing with 10 additions and 2 deletions.
  1. +10 −2 finsrv.erl
View
@@ -33,10 +33,18 @@ start_link() ->
% gen_server:start_link(?MODULE, [], []). % for unnamed gen_server
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
+%% @doc start gen_server implementation without caller link
+%% @spec start() -> {ok, Pid} | ignore | {error, Error}
+%% where
+%% Pid = pid(),
+%% Error = {already_started, Pid} | term()
+start() ->
+ gen_server:start({local, ?SERVER}, ?MODULE, [], []).
+
%% @doc stops gen_server implementation process
%% @spec stop() -> ok
stop() ->
- gen_server:cast(?MODULE, stop).
+ gen_server:cast(?SERVER, stop).
% TODO: add more public API here...
@@ -71,7 +79,7 @@ terminate(shutdown, _State) ->
ok;
terminate({shutdown, _Reason}, _State) ->
ok;
-terminate(Reason, _State) ->
+terminate(_Reason, _State) ->
ok.
%%%.

0 comments on commit be024ce

Please sign in to comment.