From 1fb616dac50969cef3f260ec9d899f2f980fca1d Mon Sep 17 00:00:00 2001 From: Gabor Liptak Date: Sat, 29 Jan 2011 15:52:39 -0500 Subject: Update Handling Other Messages section in gen_server, gen_fsm, gen_events overviews --- system/doc/design_principles/events.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'system/doc/design_principles/events.xml') diff --git a/system/doc/design_principles/events.xml b/system/doc/design_principles/events.xml index 5579f1e459..fab9e8305e 100644 --- a/system/doc/design_principles/events.xml +++ b/system/doc/design_principles/events.xml @@ -217,5 +217,22 @@ terminate(_Args, Fd) -> ok +
+ Handling Other Messages +

If the gen_event should be able to receive other messages than + events, the callback function handle_info(Info, StateName, StateData) + must be implemented to handle them. Examples of + other messages are exit messages, if the gen_event is linked to + other processes (than the supervisor) and trapping exit signals.

+ +handle_info({'EXIT', Pid, Reason}, State) -> + ..code to handle exits here.. + {ok, NewState}. +

The code_change method also has to be implemented.

+ +code_change(OldVsn, State, Extra) -> + ..code to convert state (and more) during code change + {ok, NewState} +
-- cgit v1.2.3 From d53be747c945d5e86997e1944446795b271dacb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 11 Mar 2011 17:34:22 +0100 Subject: Update copyright years --- system/doc/design_principles/events.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/doc/design_principles/events.xml') diff --git a/system/doc/design_principles/events.xml b/system/doc/design_principles/events.xml index fab9e8305e..23a9b8c7bc 100644 --- a/system/doc/design_principles/events.xml +++ b/system/doc/design_principles/events.xml @@ -4,7 +4,7 @@
- 19972009 + 19972011 Ericsson AB. All Rights Reserved. -- cgit v1.2.3