Questions tagged [gen-statem]

3 questions
2
votes
1 answer

Converting Learn You Some Erlang tutorial from gen_fsm to gen_statem

I have been going through the chapter Rage Against The Finite State Machine of the tutorial, and it uses gen_fsm, which has been deprecated in favor of gen_statem. When running the tests I always get stuck because one of the clients are on the…
sicro
  • 39
  • 3
1
vote
1 answer

What's the difference between gen_server and gen_statem?

In Erlang there are two behaviors that seem to be pretty similar: -behaviour(gen_server). -behaviour(gen_statem). What is the practical difference? When should I use one over another?
radrow
  • 6,419
  • 4
  • 26
  • 53
0
votes
0 answers

Matching a message received by a state in a gen_statem in Erlang

I have a problem matching a message received in a gen_statem in an Erlang module I've called e_counter. Here is a snap shot of the code. The gen_statem is linked to a Supervisor. When the e_counter process receives an event message from another…