I am in the process of writing my first erlang application, and I do not yet understand some parts of the erlang ecosystem and how it should be done. For example, if my application depends on some other applications, what is the way to start and stop them right away? In fact, I figured out how to get started, just put the calls application:start/1into the function of start/2the 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 the appropriate calls application:stop/1into the function myapp:stop/1and was called from the erlang shell application:stop(myapp), then later it just stops responding to any command.
source
share