Initial
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
%%% @doc
|
||||
%%% The Hakuzaru Application Interface
|
||||
%%%
|
||||
%%% This module provides the Erlang system application behavior only.
|
||||
%%% Please refer to the hz.erl module for the API.
|
||||
%%% @end
|
||||
|
||||
-module(hakuzaru).
|
||||
-behavior(application).
|
||||
|
||||
|
||||
% OTP Application Interface
|
||||
-export([start/0, stop/0]).
|
||||
-export([start/2, stop/1]).
|
||||
|
||||
|
||||
|
||||
-spec start() -> ok | {error, Reason :: term()}.
|
||||
%% @doc
|
||||
%% Public function for manually starting the Hakuzaru application.
|
||||
%%
|
||||
%% NOTE:
|
||||
%% To start it as a subordinate service within your own supervision tree rather than
|
||||
%% as a peer Erlang application within your node, add the hz_sup to your own
|
||||
%% supervision tree.
|
||||
|
||||
start() ->
|
||||
application:start(hakuzaru).
|
||||
|
||||
|
||||
-spec stop() -> ok | {error, Reason :: term()}.
|
||||
%% @doc
|
||||
%% Public function for manually stopping the Hakuzaru application.
|
||||
|
||||
stop() ->
|
||||
application:stop(hakuzaru).
|
||||
|
||||
|
||||
-spec start(normal, term()) -> {ok, pid()}.
|
||||
%% @private
|
||||
|
||||
start(normal, _Args) ->
|
||||
hz_sup:start_link().
|
||||
|
||||
|
||||
-spec stop(term()) -> ok.
|
||||
%% @private
|
||||
|
||||
stop(_State) ->
|
||||
ok.
|
||||
Reference in New Issue
Block a user