-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make application:stop/1 callback optional #7990
base: master
Are you sure you want to change the base?
Conversation
The majority of the times it simply returns ok. In Erlang/OTP itself, only ssl and snmp implemented it. Note we didn't have to change the implementation because the callback is always invoked as `catch App:stop(Arg)`, which is also how other optional callbacks, such as `prep_stop/1` are handled.
CT Test Results 13 files 313 suites 3h 11m 37s ⏱️ For more details on these failures, see this check. Results for commit b1e516b. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
CI is failing but it may be a cache issue (other applications being recompiled before kernel?). Or let me know if you would prefer me to break this in two PRs (one that changes application.erl, another that removes its usage). |
@josevalim CI fails because the primary bootstrap needs to be updated. I pushed a commit that does that. I'll leave deciding if we want this or not to next week. |
A lot of the time the start function only calls That said, that module is typically filled by templates or copy pasting, so it being optional, or the stop callback being optional, doesn't really change much. |
Speaking of which, there is also
Meaning, instead of The more I think about it, the more I like it. Less code - less space for bugs. |
The majority of the times it simply returns ok.
In Erlang/OTP itself, only ssl and snmp implemented it.
Note we didn't have to change the implementation
because the callback is always invoked as
catch App:stop(Arg)
, which is also how other optionalcallbacks, such as
prep_stop/1
are handled.