From 3815de0c7337058991066454c246587c0dbaa664 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Tue, 16 Feb 2016 10:51:39 +0100 Subject: Change to {next_state,...} and {stop,...} return format --- lib/stdlib/doc/src/gen_statem.xml | 75 ++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 28 deletions(-) (limited to 'lib/stdlib/doc/src') 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 @@ -397,23 +397,6 @@ erlang:'!' -----> Module:State/5 - - {reply,Client,Reply} - - Reply to a client that called - call/2. - Client must be the term from the - - {call,Client} - argument to the - state function. - - {stop,Reason} - The gen_statem will call - - Module:terminate/3 - with Reason and terminate. - {insert_event,EventType,EventContent} @@ -471,6 +454,24 @@ erlang:'!' -----> Module:State/5 + + + + + + {reply,Client,Reply} + + Reply to a client that called + call/2. + Client must be the term from the + + {call,Client} + argument to the + state function. + + + + @@ -867,22 +868,39 @@ erlang:'!' -----> Module:State/5 event_type() EventContent = term() - Result = {NewState,NewStateData,StateOps} -   | {NewState,NewStateData} -   The same as {NewState,NewStateData,[]} -   | {NewStateData} -   The same as {State,NewStateData,[retry]} -   | {} -   The same as {State,StateData,[]} -   | StateOps -   The same as {State,StateData,StateOps} - + Result = {stop,Reason,NewStateData} +   The same as {stop,Reason,[],NewStateData} +   | {stop,Reason,Reply,NewStateData} +   The same as + {stop,Reason,[Reply],NewStateData} + +   | {stop,Reason,Replies,NewStateData} +   The gen_statem will first send all + Replies and then call + + Module:terminate/3 + with Reason and terminate. + +   | {next_state,NewState,NewStateData} +   The same as + {next_state,NewState,NewStateData,NewStateData,[]} + +   | {next_state,NewState,NewStateData,StateOps} +   The gen_statem will do a state transition to + NewState (which may be the same as State) + and execute all StateOps + + Reason = term() PrevState = State = NewState = state() StateData = NewStateData = state_data() + Reply = + reply_operation() + + Replies = [Reply] StateOps = [state_op()] @@ -898,7 +916,8 @@ erlang:'!' -----> Module:State/5 from this or from any other state function by returning with {reply,Client,Reply} in - StateOps + StateOps, in + Replies or by calling gen_statem:reply(Client, Reply) -- cgit v1.2.3