handle_event(Type, Content, State, Data) ->
{next_state, NextState, NewData, Actions}
| {stop, Reason, NewData}.
| {keep_state, ...}
| {keep_state_and_data, ...}
| {repeat_state, ...}
| {stop_and_reply, ...}
where
Type :: cast | {call, From} | info | timeout | ...
and you take Actions to mean "a list of Action" with
the following signanture:
Action ::
% enter_action()
%% reply_action()
{reply, From :: from(), Reply :: term()}
%% timeout_action()
| {Time :: event_timeout()}
| {timeout, Time :: event_timeout(), EventContent :: event_content()}
| {timeout, Time :: event_timeout(), EventContent :: event_content(), Options :: timeout_options() }
| (...)
%% Others kinds of enter_action()
| hibernate
| {hibernate, Hibernate :: hibernate()}
% Other kinds of Actions
| postpone
| {postpone, Postpone :: postpone()}
| {next_event, EventType :: event_type(), EventContent :: event_content() }
| {change_callback_module, NewModule :: module(), EventContent :: event_content() }
| {push_callback_module, NewModule :: module()}
| pop_callback_module
| ...