aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/design_principles/events.xml
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-03-17 12:19:57 +0100
committerMicael Karlberg <[email protected]>2011-03-17 12:19:57 +0100
commit6b1d1ab0a27e9ed08a626e18319beb91d0a0d5ce (patch)
tree82e54daec07390bb4cad8b279e0e8d1fd0170b78 /system/doc/design_principles/events.xml
parent4f42486c2f94860c1aa8152562760b6a2aa7c5cb (diff)
parentf861b4fdb3fd39e35f2951c53a73b30a98c7f973 (diff)
downloadotp-6b1d1ab0a27e9ed08a626e18319beb91d0a0d5ce.tar.gz
otp-6b1d1ab0a27e9ed08a626e18319beb91d0a0d5ce.tar.bz2
otp-6b1d1ab0a27e9ed08a626e18319beb91d0a0d5ce.zip
Merge branch 'dev' into bmk/inets/ftp/missing_spec_causes_dialyxer_problems/OTP-9114
Also fixed a bunch of "end-years" (was 2010 but should have been 2011, which the commit hook not happy with).
Diffstat (limited to 'system/doc/design_principles/events.xml')
-rw-r--r--system/doc/design_principles/events.xml19
1 files changed, 18 insertions, 1 deletions
diff --git a/system/doc/design_principles/events.xml b/system/doc/design_principles/events.xml
index 5579f1e459..23a9b8c7bc 100644
--- a/system/doc/design_principles/events.xml
+++ b/system/doc/design_principles/events.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -217,5 +217,22 @@ terminate(_Args, Fd) ->
ok</pre>
</section>
</section>
+ <section>
+ <title>Handling Other Messages</title>
+ <p>If the gen_event should be able to receive other messages than
+ events, the callback function <c>handle_info(Info, StateName, StateData)</c>
+ 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.</p>
+ <code type="none">
+handle_info({'EXIT', Pid, Reason}, State) ->
+ ..code to handle exits here..
+ {ok, NewState}.</code>
+ <p>The code_change method also has to be implemented.</p>
+ <code type="none">
+code_change(OldVsn, State, Extra) ->
+ ..code to convert state (and more) during code change
+ {ok, NewState}</code>
+ </section>
</chapter>