[erlang-questions] gen_statem confusion

Fred Hebert <>
Wed Jan 18 21:48:21 CET 2017


On 01/18, Kenneth Lakin wrote:
>You need to be a little careful with this. next_event is a _stack_, not
>a queue. [...] It's really easy to overlook this. This subtle quirk was 
>the cause of at least one bug in a _widely_ used library.

Specifically I copied the terminology from the docs at 
http://erlang.org/doc/man/gen_statem.html#type-action :

> The stored events are inserted in the queue as the next to process 
> before any already queued events. The order of these stored events is 
> preserved, so the first next_event in the containing list becomes the 
> first to process. 

I guess that could use some rewording.


More information about the erlang-questions mailing list