aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src/gen_server.xml
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-12-04 09:32:50 +0000
committerErlang/OTP <[email protected]>2009-12-04 09:32:50 +0000
commitb1821b0f692deb93b9cae69ca9a1a591f5530474 (patch)
treee48846f9d9734b5bda7088acc23d44623b99030a /lib/stdlib/doc/src/gen_server.xml
parent5bf73e1dc401a205e02432d3e8ebedde0ad7f117 (diff)
parent88b530ea24977081020feb2123124063e58dfc12 (diff)
downloadotp-b1821b0f692deb93b9cae69ca9a1a591f5530474.tar.gz
otp-b1821b0f692deb93b9cae69ca9a1a591f5530474.tar.bz2
otp-b1821b0f692deb93b9cae69ca9a1a591f5530474.zip
Merge branch 'sv/sys_get_status' into ccase/r13b04_dev
* sv/sys_get_status: Teach sys:get_status/1,2 to call Mod:format_status/2 gen_fsm: Fix format_status/2 to handle Pids OTP-8324 The ability for the gen_server and gen_fsm callback modules to format their own state for display under the sys:get_status/1,2 calls has been restored and documented. (Thanks to Steve Vinoski.)
Diffstat (limited to 'lib/stdlib/doc/src/gen_server.xml')
-rw-r--r--lib/stdlib/doc/src/gen_server.xml29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml
index 8496802259..30c04d1d52 100644
--- a/lib/stdlib/doc/src/gen_server.xml
+++ b/lib/stdlib/doc/src/gen_server.xml
@@ -598,6 +598,35 @@ gen_server:abcast -----> Module:handle_cast/2
<p>The function should return the updated internal state.</p>
</desc>
</func>
+ <func>
+ <name>Module:format_status(normal, [PDict, State]) -> Status</name>
+ <fsummary>Optional function for providing a term describing the
+ current gen_server status.</fsummary>
+ <type>
+ <v>PDict = [{Key, Value}]</v>
+ <v>State = term()</v>
+ <v>Status = [term()]</v>
+ </type>
+ <desc>
+ <p><em>This callback is optional, so callback modules need not
+ export it. The gen_server module provides a default
+ implementation of this function that returns the callback
+ module state.</em></p>
+ <p>This function is called by a gen_server process when one
+ of <seealso marker="sys#get_status/1">sys:get_status/1,2</seealso>
+ is invoked to get the gen_server status. A callback module
+ wishing to customise the <c>sys:get_status/1,2</c> return
+ value exports an instance of <c>format_status/2</c> that
+ returns a term describing the current status of the
+ gen_server.</p>
+ <p><c>PDict</c> is the current value of the gen_server's
+ process dictionary.</p>
+ <p><c>State</c> is the internal state of the gen_server.</p>
+ <p>The function should return <c>Status</c>, a list of one or
+ more terms that customise the details of the current state
+ and status of the gen_server.</p>
+ </desc>
+ </func>
</funcs>
<section>