[erlang-questions] gen_fsm internal transition

Szepes Tamás tamas@REDACTED
Thu Jan 24 18:14:16 CET 2013


All,

What is the right way of doing an internal state transition in a gen_fsm?

Is the following pattern safe to use?

state_name(Event, From, State) ->
    .
    .
    .
    gen_fsm:send_event_after(0, internal_transition),
    {next_state, state_name1, State}.

state_name1(internal_transition, From, State) ->
    .
    .
    .
    {reply, ok, state_name1, State}.

Thanks,
Tamas




More information about the erlang-questions mailing list