diff options
author | José Valim <jose.valim@dashbit.co> | 2023-01-26 10:50:21 +0100 |
---|---|---|
committer | José Valim <jose.valim@dashbit.co> | 2023-02-08 20:44:27 +0100 |
commit | aacd04074c72bf89eac442c41d753efaffb2e639 (patch) | |
tree | d9bb17f870bc0fcec8e2f7a718f816faf9ce5241 /lib/kernel/doc | |
parent | bdf564f8ee2ef847a33dded0f30bb9073779ace7 (diff) | |
download | erlang-aacd04074c72bf89eac442c41d753efaffb2e639.tar.gz |
Start children applications concurrently
We build a DAG with all application dependencies
and start leaves recursively. As each application
starts, we further traverse the graph looking for
more leaves.
In order to maximize this new feature, we also
allow a list of applications to be given to
application:ensure_all_started/3.
Diffstat (limited to 'lib/kernel/doc')
-rw-r--r-- | lib/kernel/doc/src/application.xml | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/kernel/doc/src/application.xml b/lib/kernel/doc/src/application.xml index 2a807e62bb..e62ac2606e 100644 --- a/lib/kernel/doc/src/application.xml +++ b/lib/kernel/doc/src/application.xml @@ -69,12 +69,21 @@ <func> <name name="ensure_all_started" arity="1" since="OTP R16B02"/> <name name="ensure_all_started" arity="2" since="OTP R16B02"/> - <fsummary>Load and start an application and its dependencies, recursively.</fsummary> + <name name="ensure_all_started" arity="3" since="OTP 26.0"/> + <fsummary>Loads and starts all applications and their dependencies, recursively.</fsummary> <desc> - <p>Equivalent to calling + <p><c><anno>Applications</anno></c> is either an an <c>atom()</c> or a list + of <c>atom()</c> representing multiple applications.</p> + <p>This function is equivalent to calling <seemfa marker="#start/1"><c>start/1,2</c></seemfa> - repeatedly on all dependencies that are not yet started for an application. + repeatedly on all dependencies that are not yet started of each application. Optional dependencies will also be loaded and started if they are available.</p> + <p>The <c><anno>Mode</anno></c> argument controls if the applications should + be started in <c>serial</c> mode (one at a time) or <c>concurrent</c> mode. + In concurrent mode, a dependency graph is built and the leaves of the graph + are started concurrently and recursively. In both modes, no assertion can be + made about the order the applications are started. If not supplied, it defaults + to <c>serial</c>.</p> <p>Returns <c>{ok, AppNames}</c> for a successful start or for an already started application (which is, however, omitted from the <c>AppNames</c> list).</p> <p>The function reports <c>{error, {AppName,Reason}}</c> for errors, where |