Sometimes you need just an FSM without attached process/thread with mailbox/queue (i.e. passive FSM).
Then you have an API to dispatch events and query current state.
For example if you have gen_server using FSM, with gen_fsm you will have 2 processes. If there was passive FSM module, you would save 1 process and handle twice as many simultaneous clients.
For example if you have gen_server using FSM, with gen_fsm you will have 2 processes. If there was passive FSM module, you would save 1 process and handle twice as many simultaneous clients.
Some examples from boost statechart library:
http://www.boost.org/doc/libs/1_34_0/libs/statechart/doc/tut...