From 4ebdabdca2c964887115f21405993f3916843d10 Mon Sep 17 00:00:00 2001
From: Raimo Niskanen
+ No state entry event will be inserted after a
+
+ Note that a state entry event will be inserted
+ when entering the initial state even though this formally
+ is not a state change. In this case
- If the atom
- No state entry event will be inserted after a
-
If this function's body does not return an inline constant diff --git a/system/doc/design_principles/statem.xml b/system/doc/design_principles/statem.xml index 8090016b54..43359829b2 100644 --- a/system/doc/design_principles/statem.xml +++ b/system/doc/design_principles/statem.xml @@ -989,7 +989,17 @@ do_unlock() -> from your state machine to itself.
- One example of using self-generated events can be when you have + One example for this is to pre-process incoming data, for example + decrypting chunks or collecting characters up to a line break. + This could be modelled with a separate state machine that sends + the pre-processed events to the main state machine, or to decrease + overhead the small pre-processing state machine can be implemented + in the common state event handling of the main state machine + using a few state data variables and then send the pre-processed + events as internal events to the main state machine. +
+
+ Another example of using self-generated events can be when you have
a state machine specification that uses state entry actions.
You can code that using a dedicated function
to do the state transition. But if you want that code to be
@@ -1050,7 +1060,15 @@ enter(Tag, State, Data) ->
+ You can also in the previous example choose to generate
+ events looking just like the events you get from using
+