From db632b91f41c4a01be68d821d6942ff32b86e40b Mon Sep 17 00:00:00 2001 From: Zandra Norman Date: Mon, 23 Jan 2017 16:07:52 +0100 Subject: stdlib: Make gen_event callbacks optional --- lib/stdlib/doc/src/gen_event.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/gen_event.xml b/lib/stdlib/doc/src/gen_event.xml index 42e952fd46..56cb7974a2 100644 --- a/lib/stdlib/doc/src/gen_event.xml +++ b/lib/stdlib/doc/src/gen_event.xml @@ -579,6 +579,13 @@ gen_event:stop -----> Module:terminate/2 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/3 + isn't implemented the event handler will crash with an undef error + reason.

+

This function is called for an installed event handler that is to update its internal state during a release upgrade/downgrade, that is, when the instruction @@ -759,6 +766,12 @@ gen_event:stop -----> Module:terminate/2   Id = term() + +

This callback is optional, so callback modules need not + export it. The gen_event 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 for each installed event handler when an event manager receives any other message than an event or a synchronous request (or a system message).

@@ -815,6 +828,11 @@ gen_event:stop -----> Module:terminate/2  Args = Reason = Term = term() + +

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

+

Whenever an event handler is deleted from an event manager, this function is called. It is to be the opposite of Module:init/1 -- cgit v1.2.3