From 215f61f223a07493d1147a04375d11f3c7819e42 Mon Sep 17 00:00:00 2001 From: Zandra Norman Date: Tue, 24 Jan 2017 13:40:21 +0100 Subject: stdlib: Make gen_fsm callbacks optional --- lib/stdlib/doc/src/gen_fsm.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/gen_fsm.xml b/lib/stdlib/doc/src/gen_fsm.xml index 719ab2b558..691a039e34 100644 --- a/lib/stdlib/doc/src/gen_fsm.xml +++ b/lib/stdlib/doc/src/gen_fsm.xml @@ -562,6 +562,13 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4 Extra = 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/4 + isn't implemented the process will crash with an undef exit + reason.

+

This function is called by a gen_fsm process when it is to update its internal state data during a release upgrade/downgrade, that is, when instruction {update,Module,Change,...}, @@ -686,6 +693,13 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4  Reason = normal | term() + +

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

+

This function is called by a gen_fsm process when it receives any other message than a synchronous or asynchronous event (or a system message).

@@ -899,6 +913,11 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4 StateData = term() + +

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

+

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