Skip to content
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

Explain {continue,Continue} in gen_server:Module:init/1 doc #3011

Merged
merged 1 commit into from
Feb 1, 2021
Merged

Explain {continue,Continue} in gen_server:Module:init/1 doc #3011

merged 1 commit into from
Feb 1, 2021

Conversation

ergl
Copy link
Contributor

@ergl ergl commented Jan 28, 2021

The value or the usage of {continue,Continue} is not explained on the documentation of Module:init/1. Although the meaning of {continue,Continue} and handle_continue/2 are explained at the beginning of the gen_server documentation, I believe the context is lost if one is only reading the documentation of the individual functions, instead of reading the documentation for the entire module.

In the same vein, if one is reading the code for gen_server, the term Timeout might be confusing, because it can also refer to other values (hibernate or continue).

@ranjanified
Copy link
Contributor

Only for the sake of discussion, can we rename "Extra" to something more meaningful, as it gives a sense of non-mandatory-ness, however the value in that position is very very involved in selecting the function clause of "loop" which will be executed. LoopSelector or LoopSelectionData etc.. Just my thoughts.

lib/stdlib/src/gen_server.erl Outdated Show resolved Hide resolved
lib/stdlib/src/gen_server.erl Outdated Show resolved Hide resolved
@rickard-green rickard-green added the team:VM Assigned to OTP team VM label Feb 1, 2021
@ergl
Copy link
Contributor Author

ergl commented Feb 1, 2021

Applied suggestions since I wasn't too married to the current naming.

Also, make clear in the code that the third term returned by
Module:init/1  can more than just a timeout.
@ranjanified
Copy link
Contributor

Thanks. Indeed, sensible and even closer to the context. I only had an opinion. Even I am not married to names, either. :D

@rickard-green rickard-green self-assigned this Feb 1, 2021
@rickard-green rickard-green merged commit 05d8c16 into erlang:master Feb 1, 2021
@ergl ergl deleted the ergl/fix_gen_server_docs branch February 1, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants