From d840b24857a1d54419953661f70716c449c11864 Mon Sep 17 00:00:00 2001
From: Raimo Niskanen
Date: Thu, 3 Mar 2016 10:54:01 +0100
Subject: Fix most of the system docs and emacs mode
---
lib/stdlib/doc/src/gen_statem.xml | 87 +++++++++++++++++++++++++++++----------
1 file changed, 66 insertions(+), 21 deletions(-)
(limited to 'lib/stdlib/doc/src/gen_statem.xml')
diff --git a/lib/stdlib/doc/src/gen_statem.xml b/lib/stdlib/doc/src/gen_statem.xml
index 01be3099c1..db6a4e03ea 100644
--- a/lib/stdlib/doc/src/gen_statem.xml
+++ b/lib/stdlib/doc/src/gen_statem.xml
@@ -407,7 +407,7 @@ ok
- After a state change (NewState =/= State)
+ After a state change (NextState =/= State)
all postponed events are retried.
@@ -566,7 +566,7 @@ ok
If true postpone the current event and retry
it when the state changes that is:
- NewState =/= State.
+ NextState =/= State.
@@ -701,7 +701,47 @@ ok
-
+
+
+
+ next_state
+ -
+ The gen_statem will do a state transition to
+ NextStateName
+ (which may be the same as the current state),
+ set NewData
+ and execute all Actions
+
+
+
+ All these terms are tuples or atoms and this property
+ will hold in any future version of gen_statem,
+ just in case you need such a promise.
+
+
+
+
+
+
+
+ next_state
+ -
+ The gen_statem will do a state transition to
+ NextState
+ (which may be the same as the current state),
+ set NewData
+ and execute all Actions
+
+
+
+ All these terms are tuples or atoms and this property
+ will hold in any future version of gen_statem,
+ just in case you need such a promise.
+
+
+
+
+
stop
@@ -723,14 +763,6 @@ ok
with Reason and
NewData, if given.
- next_state
- -
- The gen_statem will do a state transition to
- NewState
- (which may be the same as the current state),
- set NewData
- and execute all Actions
-
keep_state
-
The gen_statem will keep the current state, or
@@ -1209,10 +1241,11 @@ ok
- Module:StateName(EventType, EventContent, Data) -> Result
+ Module:StateName(EventType, EventContent, Data) ->
+ StateFunctionResult
Module:handle_event(EventType, EventContent,
- State, Data) -> Result
+ State, Data) -> HandleEventResult
Handle an event
@@ -1222,7 +1255,7 @@ ok
EventContent = term()
- State = NewState =
+ State =
state()
@@ -1230,9 +1263,15 @@ ok
data()
- Result =
-
- state_callback_result()
+ StateFunctionResult =
+
+ state_function_result()
+
+
+
+ HandleEventResult =
+
+ handle_event_result()
@@ -1260,9 +1299,15 @@ ok
reply(Caller, Reply).
- If this function returns with a new state that
+ If this function returns with a next state that
does not match equal (=/=) to the current state
- all postponed events will be retried in the new state.
+ all postponed events will be retried in the next state.
+
+
+ The only difference between StateFunctionResult and
+ HandleEventResult is that for StateFunctionResult
+ the next state has to be an atom but for HandleEventResult
+ there is no restriction on the next state.
See action()
@@ -1272,7 +1317,7 @@ ok
These functions may use
throw,
- to return Result.
+ to return the result.
@@ -1401,7 +1446,7 @@ ok
If successful, the function shall return the updated
internal state in an
- {ok,{NewState,NewData}} tuple.
+ {ok,NewState,NewData} tuple.
If the function returns Reason, the ongoing
--
cgit v1.2.3