Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang: Implementing a Finite State Machine using gen_fsm

Tags:

erlang

gen-fsm

I'm looking for an example of a simple FSM implemented in Erlang using the gen_fsm from OTP.

like image 348
Finite State Machine Avatar asked Aug 18 '10 23:08

Finite State Machine


2 Answers

I found this tutorial really helpful -

http://spawnlink.com/articles/an-introduction-to-gen_fsm-erlybanks-atm/index.html

like image 177
spkhaira Avatar answered Nov 19 '22 12:11

spkhaira


You can also refer to the official erlang documentation.

http://www.erlang.org/doc/design_principles/fsm.html

The locked door example reported in the link is quite easy to understand

like image 5
the_dark_destructor Avatar answered Nov 19 '22 13:11

the_dark_destructor