Hello<div><br></div><div>During years of work with Erlang/OTP I had many troubles with gen_fsm and me not alone. A number of people who I know have the same troubles.</div><div>Here some of them:</div><div><div><br></div><div>
1. gen_fsm incompatible with gen_server. We cannot use synchronous call from gen_server for gen_fsm because it different.</div><div>2. Two different actions: send_event и send_all_state_event with different handlers. Why? If we want to send message to FSM, we just send message to process without knowledge of its internal state-related issues, right?</div>
<div>3. For complex protocols and when one message emits almost equal actions in various process states, code of gen_fsm-process becomes pumpkinized. Every time I start writing a new gen_fsm module, I think that this time the code will not become pumpkinized, but this wrong. Large number of pattern matching with records in events and internal state of process in various state handlers makes code duplicated and unreadable.</div>
<div><br></div><div>Is there any best practices in gen_fsm usage? May be I and other people uses gen_fsm improperly?</div><div><br></div><div>Great Thanks</div><div><br></div>-- <br>Maxim Treskin<br>
</div>