From 447f3cf2d041670d93683de4fab02338b26fbaf1 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Thu, 3 Mar 2016 11:27:02 +0100 Subject: Rename state_timeout -> event_timeout --- lib/stdlib/doc/src/gen_statem.xml | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 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 db6a4e03ea..4489ddfb91 100644 --- a/lib/stdlib/doc/src/gen_statem.xml +++ b/lib/stdlib/doc/src/gen_statem.xml @@ -155,7 +155,7 @@ erlang:'!' -----> Module:StateName/3

Inserting an event replaces the trick of calling your own state handling functions that you often would have to - resort to in e.g gen_fsm + resort to in for example gen_fsm to force processing an inserted event before others. If you for example in gen_statem postpone an event in one state and then call some other state function of yours, @@ -529,17 +529,16 @@ ok all other events. - If a - - state_timeout() + If an + + event_timeout() is set through action() timeout - a state timer may be started or a timeout zero event - may be enqueued as the newest incoming, that is the last - to process before going into receive for new events. + an event timer may be started or a timeout zero event + may be enqueued. The (possibly new) @@ -588,7 +587,7 @@ ok - +

Generate an event of @@ -600,7 +599,8 @@ ok If the value is infinity no timer is started. If it is 0 the timeout event is immediately enqueued as the newest received - (unless there are retried or inserted events to process). + (unless there are retried or inserted events to process + since then the timeout is cancelled). Also note that it is not possible nor needed to cancel this timeout since it is cancelled automatically by any other event. @@ -653,15 +653,25 @@ ok for this state transition. + Timeout + + Short for {timeout,Timeout} that is + the timeout message is the timeout time. + This form exists to make the + state function + return value {next_state,NextState,NewData,Timeout} + allowed like for + + gen_fsm Module:StateName/2. + timeout Set the - transition_option() state_timeout() + transition_option() event_timeout() to Time with the - EventContent as Msg - for the next state. + EventContent as Msg. reply_action() Reply to a caller. @@ -1419,7 +1429,7 @@ ok

This function is called by a gen_statem when it should update its internal state during a release upgrade/downgrade, - i.e. when the instruction {update,Module,Change,...} + that is when the instruction {update,Module,Change,...} where Change={advanced,Extra} is given in the appup file. See -- cgit v1.2.3