diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/doc/design_principles/events.xml | 17 | ||||
-rw-r--r-- | system/doc/design_principles/fsm.xml | 5 | ||||
-rw-r--r-- | system/doc/design_principles/gen_server_concepts.xml | 5 | ||||
-rw-r--r-- | system/doc/efficiency_guide/advanced.xml | 4 | ||||
-rw-r--r-- | system/doc/top/src/erl_html_tools.erl | 14 |
5 files changed, 36 insertions, 9 deletions
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</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> diff --git a/system/doc/design_principles/fsm.xml b/system/doc/design_principles/fsm.xml index 7cdd62057b..c3e9027274 100644 --- a/system/doc/design_principles/fsm.xml +++ b/system/doc/design_principles/fsm.xml @@ -308,6 +308,11 @@ terminate(normal, _StateName, _StateData) -> handle_info({'EXIT', Pid, Reason}, StateName, StateData) -> ..code to handle exits here.. {next_state, StateName1, StateData1}.</code> + <p>The code_change method also has to be implemented.</p> + <code type="none"> +code_change(OldVsn, StateName, StateData, Extra) -> + ..code to convert state (and more) during code change + {ok, NextStateName, NewStateData}</code> </section> </chapter> diff --git a/system/doc/design_principles/gen_server_concepts.xml b/system/doc/design_principles/gen_server_concepts.xml index 8131c47a69..231333da0e 100644 --- a/system/doc/design_principles/gen_server_concepts.xml +++ b/system/doc/design_principles/gen_server_concepts.xml @@ -264,6 +264,11 @@ terminate(normal, State) -> handle_info({'EXIT', Pid, Reason}, State) -> ..code to handle exits here.. {noreply, State1}.</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> diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml index 2383e3cf3d..8126b93a2d 100644 --- a/system/doc/efficiency_guide/advanced.xml +++ b/system/doc/efficiency_guide/advanced.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2001</year><year>2010</year> + <year>2001</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -200,7 +200,7 @@ On 64-bit architectures: 4 words for a reference from the current local node, an <seealso marker="#ports">the maximum number of Erlang ports</seealso> available, and operating system specific settings and limits.</item> <tag><em>Number of arguments to a function or fun</em></tag> - <item>256</item> + <item>255</item> </taglist> </section> </chapter> diff --git a/system/doc/top/src/erl_html_tools.erl b/system/doc/top/src/erl_html_tools.erl index 599268804e..bb6a9a9f0a 100644 --- a/system/doc/top/src/erl_html_tools.erl +++ b/system/doc/top/src/erl_html_tools.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -134,10 +134,10 @@ subst_file(Group, OutFile, Template, Info) -> file:write(Stream, Text), file:close(Stream); Error -> - error("Can't write to file ~s: ~w", [OutFile,Error]) + local_error("Can't write to file ~s: ~w", [OutFile,Error]) end; Error -> - error("Can't write to file ~s: ~w", [OutFile,Error]) + local_error("Can't write to file ~s: ~w", [OutFile,Error]) end. @@ -156,7 +156,7 @@ find_templates([SearchPath | SearchPaths], AllSearchPaths) -> Result end; find_templates([], AllSearchPaths) -> - error("No templates found in ~p",[AllSearchPaths]). + local_error("No templates found in ~p",[AllSearchPaths]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -269,7 +269,7 @@ find_application_infos([{App, Vsn, AppPath, IndexURL} | Paths]) -> string:substr(G0,N+1)} end; false -> - error("No group given",[]) + local_error("No group given",[]) end, Text = case lists:keysearch("short", 1, Db) of @@ -427,7 +427,7 @@ subst_applinks_1([{G, Heading}|Gs], Info0, Group) -> end; subst_applinks_1([], [], _) -> []; subst_applinks_1([], Info, _) -> - error("Info left: ~p\n", [Info]), + local_error("Info left: ~p\n", [Info]), []. html_applinks([{Name,[{_,_,URL,_}|_]}|AppNames]) -> @@ -669,7 +669,7 @@ sub_repl([], _Fun, Acc, S, Pos) -> {string:substr(S, Pos+1), Acc}. % Error and warnings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -error(Format, Args) -> +local_error(Format, Args) -> io:format("ERROR: " ++ Format ++ "\n", Args), exit(1). |