aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/gen_statem.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib/src/gen_statem.erl')
-rw-r--r--lib/stdlib/src/gen_statem.erl38
1 files changed, 26 insertions, 12 deletions
diff --git a/lib/stdlib/src/gen_statem.erl b/lib/stdlib/src/gen_statem.erl
index aedcfc932f..9f5573af86 100644
--- a/lib/stdlib/src/gen_statem.erl
+++ b/lib/stdlib/src/gen_statem.erl
@@ -142,7 +142,7 @@
NextStateName :: state_name(),
NewData :: data(),
Actions :: [action()] | action()} |
- common_state_callback_result().
+ keep_state_callback_result().
-type state_function_enter_result() ::
{'next_state', % {next_state,NextStateName,NewData,[]}
NextStateName :: state_name(),
@@ -151,7 +151,7 @@
NextStateName :: state_name(),
NewData :: data(),
Actions :: [enter_action()] | enter_action()} |
- common_state_callback_result().
+ keep_state_callback_enter_result().
-type handle_event_result() ::
{'next_state', % {next_state,NextState,NewData,[]}
@@ -161,7 +161,7 @@
NextState :: state(),
NewData :: data(),
Actions :: [action()] | action()} |
- common_state_callback_result().
+ keep_state_callback_result().
-type handle_event_enter_result() ::
{'next_state', % {next_state,NextState,NewData,[]}
NextState :: state(),
@@ -170,6 +170,28 @@
NextState :: state(),
NewData :: data(),
Actions :: [enter_action()] | enter_action()} |
+ keep_state_callback_enter_result().
+
+-type keep_state_callback_result() ::
+ {'keep_state', % {keep_state,NewData,[]}
+ NewData :: data()} |
+ {'keep_state', % Keep state, change data
+ NewData :: data(),
+ Actions :: [action()] | action()} |
+ 'keep_state_and_data' | % {keep_state_and_data,[]}
+ {'keep_state_and_data', % Keep state and data -> only actions
+ Actions :: [action()] | action()} |
+ common_state_callback_result().
+
+-type keep_state_callback_enter_result() ::
+ {'keep_state', % {keep_state,NewData,[]}
+ NewData :: data()} |
+ {'keep_state', % Keep state, change data
+ NewData :: data(),
+ Actions :: [enter_action()] | enter_action()} |
+ 'keep_state_and_data' | % {keep_state_and_data,[]}
+ {'keep_state_and_data', % Keep state and data -> only actions
+ Actions :: [enter_action()] | enter_action()} |
common_state_callback_result().
-type common_state_callback_result() ::
@@ -185,15 +207,7 @@
{'stop_and_reply', % Reply then stop the server
Reason :: term(),
Replies :: [reply_action()] | reply_action(),
- NewData :: data()} |
- {'keep_state', % {keep_state,NewData,[]}
- NewData :: data()} |
- {'keep_state', % Keep state, change data
- NewData :: data(),
- Actions :: [ActionType] | ActionType} |
- 'keep_state_and_data' | % {keep_state_and_data,[]}
- {'keep_state_and_data', % Keep state and data -> only actions
- Actions :: [ActionType] | ActionType}.
+ NewData :: data()}.
%% The state machine init function. It is called only once and