I am in the process of writing my first erlang application and I don't understand yet some parts of the erlang ecosystem and how things should be done in it. For example if my app depends on some other apps what is the way to start and stop them at once ? Actually, I've figured out how to start, just put application:start/1
calls in the start/2
function of the application module:
-module(myapp).
-behaviour(application).
-export([start/0, start/2, stop/1]).
start(_Type, _StartArgs) ->
ok = application:start(ssl),
ok = application:start(inets),
ok = application:start(log4erl),
myapp_sup:start_link().
stop(_State) ->
ok.
But when I tried to put corresponding application:stop/1
calls into the myapp:stop/1
function and called from the erlang shell application:stop(myapp)
the later just stopped responding to any command.