forked from mbbx6spp/rebar-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
finevt.erl
59 lines (51 loc) · 1.41 KB
/
finevt.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%%%' HEADER
%%% @author {{author_name}} <{{author_email}}>
%%% @copyright {{copyright_year}} {{author_name}}
%%% @doc gen_event that {{description}}
%%% @end
-module({{name}}).
-author('{{author_name}} <{{author_email}}>').
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2]).
-ifdef(TEST).
-compile(export_all).
-endif.
%%%.
%%%' PUBLIC API
%% TODO: Add public API methods here...
%%%.
%%%' CALLBACKS
%% @private
%% @spec init(Args0) -> {ok, Args1}
%% where
%% Args0 = Args1 = [term()]
%% @doc initializes gen_event
init([]) ->
{ok, Args}.
%% @private
%% @spec handle_event(Event, State0) -> {ok, State1} | {ok, State1, hibernate} |
%% {swap_handler, Args1, State1, Handler2, Args2} | remove_handler
%% where
%% Event = term()
%% State0 = State1 = term()
%% Args1 = Args2 = term()
%% Handler2 = Module2 | {Module2, Id}
%% Module2 = atom()
%% Id = term()
%% @doc handle/log event
handle_event(_Message, State) ->
{ok, State}.
%% @spec terminate(Args, State0) -> ok
%% where
%% State0 = term()
%% Args = term() | {stop, Reason} | stop | remove_handler |
%% {error, {'EXIT', Reason}} | {error, Term}
%% Reason = Term = term()
%% terminates gen_event
terminate(_Args, _State) ->
ok.
%%%.
%%%' PRIVATE FUNCTIONS
%% TODO: Add private functions here...
%%%.
%%% vim: set filetype=erlang tabstop=2 foldmarker=%%%',%%%. foldmethod=marker: