summaryrefslogtreecommitdiffstats
path: root/src/core/ephraim.erl
blob: c0736c6232820058a2d8a076ebf3858991a17ece (plain)
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
-module(ephraim).
-behaviour(application).
-behaviour(supervisor).
-export([start/2, stop/1]).
-export([init/1]).
-export([notify/1]).

%-spec start() -> ok.
start(_Type, _Args) ->
    Result = supervisor:start_link(?MODULE, []),
    ephraim_gui:start(),
    Result.

%-spec stop() -> ok.
stop(_State) ->
    ok.

-spec init(term()) -> ok.
init(_Args) ->
    {ok, {{rest_for_one, 1, 60},
	  [{event_man, {gen_event, start_link, [{local, ephraim_event_man}]}, permanent, 1000, worker, [gen_event]},
	   {config, {ephraim_config, start_link, []}, permanent, 1000, worker, [ephraim_config]},
	   {accounts, {ephraim_accounts, start_link, []}, permanent, infinity, supervisor, [ephraim_accounts]}]}}.

-spec notify(term()) -> ok.
notify(Event) ->
    gen_event:notify(ephraim_event_man, Event).