Stage 1
This commit is contained in:
24
src/eventhub_app.erl
Normal file
24
src/eventhub_app.erl
Normal file
@@ -0,0 +1,24 @@
|
||||
%% Основной модуль приложения
|
||||
-module(eventhub_app).
|
||||
-behaviour(application).
|
||||
|
||||
-export([start/2, stop/1]).
|
||||
|
||||
start(_StartType, _StartArgs) ->
|
||||
% Запускаем Mnesia
|
||||
application:ensure_all_started(mnesia),
|
||||
|
||||
case infra_sup:start_link() of
|
||||
{ok, Pid} ->
|
||||
% Инициализируем таблицы и ждем готовности
|
||||
ok = infra_mnesia:init_tables(),
|
||||
ok = infra_mnesia:wait_for_tables(),
|
||||
|
||||
% Здесь позже запустим HTTP-сервер и другие сервисы
|
||||
{ok, Pid};
|
||||
Error ->
|
||||
Error
|
||||
end.
|
||||
|
||||
stop(_State) ->
|
||||
ok.
|
||||
Reference in New Issue
Block a user