[erlang-questions] gen_statem, postpone and repeat_state

Frans Schneider fchschneider@REDACTED
Thu Apr 19 14:47:48 CEST 2018


It was because with repeat_state the enter state call is triggered which 
suggests a start from fresh state entry. It makes sense to me to replay 
postponed events in this situation.

Frans

On 04/19/2018 01:23 PM, Fred Hebert wrote:
> On 04/19, Frans Schneider wrote:
>> Hi list,
>>
>> I was assuming that with a repeat_state in gen_statem, all postponed 
>> events would be re-evaluated. The docs give no explicit details about 
>> this as far as I know. So, was my assumption wrong or would it be 
>> logical for postponed events to be re-evaluated in this situation?
>>
> 
> Postponed events are only replayed once the state has changed. repeating 
> a state is not very different than something like
> 
>     handle_event(..., ..., current_state, Data) ->
>         {next_state, current_state, Data}.
> 
> As such I think it's the right thing that postponed events are not 
> replayed.
> 
> Regards,
> Fred.



More information about the erlang-questions mailing list