From 8ca53b0f993ffbf2991e3068b76ec15b8f5eca51 Mon Sep 17 00:00:00 2001 From: Zandra Norman Date: Mon, 23 Jan 2017 11:49:32 +0100 Subject: stdlib: Make gen_server callbacks optional --- lib/stdlib/doc/src/gen_server.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml index 662076b5f0..4540449792 100644 --- a/lib/stdlib/doc/src/gen_server.xml +++ b/lib/stdlib/doc/src/gen_server.xml @@ -504,6 +504,13 @@ gen_server:abcast -----> Module:handle_cast/2 Reason = term() + +

This callback is optional, so callback modules need not export it. + If a release upgrade/downgrade with Change={advanced,Extra} + specified in the appup file is made when code_change/3 + isn't implemented the process will crash with an undef exit + reason.

+

This function is called by a gen_server process when it is to update its internal state during a release upgrade/downgrade, that is, when the instruction {update,Module,Change,...}, @@ -690,6 +697,12 @@ gen_server:abcast -----> Module:handle_cast/2  Reason = normal | term() + +

This callback is optional, so callback modules need not + export it. The gen_server module provides a default + implementation of this function that logs about the unexpected + Info message, drops it and returns {noreply, State}.

+

This function is called by a gen_server process when a time-out occurs or when it receives any other message than a synchronous or asynchronous request (or a system message).

@@ -750,6 +763,11 @@ gen_server:abcast -----> Module:handle_cast/2 State = term() + +

This callback is optional, so callback modules need not + export it. The gen_server module provides a default + implementation without cleanup.

+

This function is called by a gen_server process when it is about to terminate. It is to be the opposite of Module:init/1 -- cgit v1.2.3