aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-02-16 10:51:39 +0100
committerRaimo Niskanen <[email protected]>2016-02-16 11:02:22 +0100
commit3815de0c7337058991066454c246587c0dbaa664 (patch)
tree57ee28e46cb622c6b0110c524ea00443b65db433 /lib/stdlib/doc
parenta07f6e35c3adb6e1536a63cc8137f48f64e2f6f7 (diff)
downloadotp-3815de0c7337058991066454c246587c0dbaa664.tar.gz
otp-3815de0c7337058991066454c246587c0dbaa664.tar.bz2
otp-3815de0c7337058991066454c246587c0dbaa664.zip
Change to {next_state,...} and {stop,...} return format
Diffstat (limited to 'lib/stdlib/doc')
-rw-r--r--lib/stdlib/doc/src/gen_statem.xml75
1 files changed, 47 insertions, 28 deletions
diff --git a/lib/stdlib/doc/src/gen_statem.xml b/lib/stdlib/doc/src/gen_statem.xml
index 83d1f1e9e6..f7ce0f61ae 100644
--- a/lib/stdlib/doc/src/gen_statem.xml
+++ b/lib/stdlib/doc/src/gen_statem.xml
@@ -398,23 +398,6 @@ erlang:'!' -----> Module:State/5
<desc>
<taglist>
<tag>
- <c>{reply,<anno>Client</anno>,<anno>Reply</anno>}</c>
- </tag>
- <item>Reply to a client that called
- <seealso marker="#call/2"><c>call/2</c></seealso>.
- <c><anno>Client</anno></c> must be the term from the
- <seealso marker="#type-event_type">
- <c>{call,<anno>Client</anno>}</c>
- </seealso> argument to the
- <seealso marker="#state_function">state function</seealso>.
- </item>
- <tag><c>{stop,<anno>Reason</anno>}</c></tag>
- <item>The gen_statem will call
- <seealso marker="#Module:terminate/3">
- <c>Module:terminate/3</c>
- </seealso> with <c><anno>Reason</anno></c> and terminate.
- </item>
- <tag>
<c>
{insert_event,<anno>EventType</anno>,<anno>EventContent</anno>}
</c>
@@ -471,6 +454,24 @@ erlang:'!' -----> Module:State/5
</taglist>
</desc>
</datatype>
+ <datatype>
+ <name name="reply_operation" />
+ <desc>
+ <taglist>
+ <tag>
+ <c>{reply,<anno>Client</anno>,<anno>Reply</anno>}</c>
+ </tag>
+ <item>Reply to a client that called
+ <seealso marker="#call/2"><c>call/2</c></seealso>.
+ <c><anno>Client</anno></c> must be the term from the
+ <seealso marker="#type-event_type">
+ <c>{call,<anno>Client</anno>}</c>
+ </seealso> argument to the
+ <seealso marker="#state_function">state function</seealso>.
+ </item>
+ </taglist>
+ </desc>
+ </datatype>
</datatypes>
<funcs>
@@ -867,22 +868,39 @@ erlang:'!' -----> Module:State/5
<seealso marker="#type-event_type">event_type()</seealso>
</v>
<v>EventContent = term()</v>
- <v>Result = {NewState,NewStateData,StateOps}</v>
- <v>&nbsp;&nbsp;| {NewState,NewStateData}</v>
- <d>&nbsp;&nbsp;The same as <c>{NewState,NewStateData,[]}</c></d>
- <v>&nbsp;&nbsp;| {NewStateData}</v>
- <d>&nbsp;&nbsp;The same as <c>{State,NewStateData,[retry]}</c></d>
- <v>&nbsp;&nbsp;| {}</v>
- <d>&nbsp;&nbsp;The same as <c>{State,StateData,[]}</c></d>
- <v>&nbsp;&nbsp;| StateOps</v>
- <d>&nbsp;&nbsp;The same as <c>{State,StateData,StateOps}</c></d>
-
+ <v>Result = {stop,Reason,NewStateData}</v>
+ <d>&nbsp;&nbsp;The same as <c>{stop,Reason,[],NewStateData}</c></d>
+ <v>&nbsp;&nbsp;| {stop,Reason,Reply,NewStateData}</v>
+ <d>&nbsp;&nbsp;The same as
+ <c>{stop,Reason,[Reply],NewStateData}</c>
+ </d>
+ <v>&nbsp;&nbsp;| {stop,Reason,Replies,NewStateData}</v>
+ <d>&nbsp;&nbsp;The gen_statem will first send all
+ <c>Replies</c> and then call
+ <seealso marker="#Module:terminate/3">
+ <c>Module:terminate/3</c>
+ </seealso> with <c>Reason</c> and terminate.
+ </d>
+ <v>&nbsp;&nbsp;| {next_state,NewState,NewStateData}</v>
+ <d>&nbsp;&nbsp;The same as
+ <c>{next_state,NewState,NewStateData,NewStateData,[]}</c>
+ </d>
+ <v>&nbsp;&nbsp;| {next_state,NewState,NewStateData,StateOps}</v>
+ <d>&nbsp;&nbsp;The gen_statem will do a state transition to
+ <c>NewState</c> (which may be the same as <c>State</c>)
+ and execute all <c>StateOps</c>
+ </d>
+ <v>Reason = term()</v>
<v>PrevState = State = NewState =
<seealso marker="#type-state">state()</seealso>
</v>
<v>StateData = NewStateData =
<seealso marker="#type-state_data">state_data()</seealso>
</v>
+ <v>Reply =
+ <seealso marker="#type-reply_operation">reply_operation()</seealso>
+ </v>
+ <v>Replies = [Reply]</v>
<v>StateOps =
[<seealso marker="#type-state_op">state_op()</seealso>]
</v>
@@ -898,7 +916,8 @@ erlang:'!' -----> Module:State/5
from this or from any other
<seealso marker="#state_function">state function</seealso>
by returning with <c>{reply,Client,Reply}</c> in
- <seealso marker="#type-state_op">StateOps</seealso>
+ <seealso marker="#type-state_op">StateOps</seealso>, in
+ <seealso marker="#type-reply_operation">Replies</seealso>
or by calling
<seealso marker="#reply/2">
<c>gen_statem:reply(Client, Reply)</c>