Reputation: 4850
So far, I know that when I start my Elixir application, a bunch of dependent applications also get started.
Are these dependent applications started inside my app supervision tree somehow?
What happens if a dependent application crashes? Is it restarted?
Upvotes: 4
Views: 556
Reputation: 14042
I guess that Elixir works like Erlang for application.
application:ensure_all_started(Application[,StartType])
, StartType can be either
temporary
: (default value): nothing occurs if a temporary
application stops for any reasonpermanent
: all other applications terminate if a permanent
application stops for any reasontransient
: all other applications terminate is a transient
application stops for any reason but normal
application:ensure_started(Application[,StartType])
for each dependencies. Note that in both cases, the StartType
only controls the effect of one application termination on the others, but there is no restart strategy applied.application:which_applications()
Upvotes: 5
Reputation: 1626
In Erlang VM all applications start as children application_master.
Every application has StartType
which can be one of temporary
, transient
and permanent
.
A permanent
and in some cases transient
application crash will affect on entire Erlang VM (VM will crash and crash.dump file will created).
According to the Elixir application module you can set type of your dependencies in start/2
.
Upvotes: 0