<div dir="ltr">Hi Fred! <div><br></div><div>OTP technical board has discussed your patch and we find the functionality useful. We would, however, like to see some adjustments:<div><div><br></div></div></div><div>1. Since the function behaves more like application:ensure_started/1,2 than application:start/1,2 we would like the new name to be ensure_all_started/1,2.</div>
<div><br></div><div>2. On failure, the current implementation potentially leaves one or more applications started. We would like it to clean up after itself in this situation.</div><div><br></div><div>3. On success, we would like the function to return {ok,StartedApps}, where StartedApps is the list of applications (names) that were actually started.</div>
<div><br></div><div>Would it be possible for you to update the patch accordingly?</div><div><br></div><div>Thanks for your contribution!</div><div>Regards</div><div>/siri</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/6/24 Fredrik <span dir="ltr"><<a href="mailto:fredrik@erlang.org" target="_blank">fredrik@erlang.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 06/20/2013 08:16 PM, Fred Hebert wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This adds two new functions to the application module that will<br>
recursively look for missing dependencies to start the entire dependency<br>
chain of a given application, and then the application itself, if<br>
possible.<br>
<br>
Its entire behavior is based on the currently existing 'start/1-2'<br>
functions, which will report dependencies that have not yet been started<br>
and other problems encountered. 'start_all/1-2' will use this<br>
information the way any programmer would manually do it to automate the<br>
process.<br>
<br>
This kind of functionality, while not OTP-ish (releases do this start<br>
sequence for the user), is still useful for testing purposes, quick<br>
demonstrations, and programmers who do not wish or know how to use OTP<br>
releases.<br>
<br>
The function returns 'ok' for all started or already started<br>
applications, and will return '{error, {AppName, Reason}}' on a failure<br>
to allow users to rapidly know why the function failed.<br>
<br>
I decided to call it start_all even though its semantics are somewhat<br>
similar to ensure_start in how it ignores already_started applications,<br>
but am open to changing the name if the OTP team prefers<br>
'ensure_all/1-2' as functions for this module.<br>
<br>
Documentation has been added, and so were tests, looking for a few<br>
simple case: simple app, app with a dependency, and apps with a<br>
3rd-level dependency not booting, all locally.<br>
<br>
Note that no specific check is made for direct or indirect circular<br>
dependencies between applications, and these will make the function go<br>
in an infinite loop.<br>
<br>
git fetch git://<a href="http://github.com/ferd/otp.git" target="_blank">github.com/ferd/otp.git</a> start-all<br>
<br>
<a href="https://github.com/ferd/otp/compare/erlang:maint...start-all" target="_blank">https://github.com/ferd/otp/<u></u>compare/erlang:maint...start-<u></u>all</a><br>
<a href="https://github.com/ferd/otp/compare/erlang:maint...start-all.patch" target="_blank">https://github.com/ferd/otp/<u></u>compare/erlang:maint...start-<u></u>all.patch</a><br>
<br>
Regards,<br>
Fred Hebert.<br>
______________________________<u></u>_________________<br>
erlang-patches mailing list<br>
<a href="mailto:erlang-patches@erlang.org" target="_blank">erlang-patches@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-patches" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-patches</a><br>
</blockquote></div></div>
Hello Fred,<br>
I've fetched your patch and assigned it to be reviewed.<br>
Thanks,<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
<br>
BR Fredrik Gustafsson<br>
Erlang OTP Team</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
erlang-patches mailing list<br>
<a href="mailto:erlang-patches@erlang.org" target="_blank">erlang-patches@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-patches" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-patches</a><br>
</div></div></blockquote></div><br></div>