<div>I submit to you my trade_fsm system as described in my Rage Against the Finite-State Machines chapter (<a href="http://learnyousomeerlang.com/finite-state-machines">http://learnyousomeerlang.com/finite-state-machines</a>)</div>

<div><br></div><div><a href="http://learnyousomeerlang.com/static/erlang/trade_fsm.erl">http://learnyousomeerlang.com/static/erlang/trade_fsm.erl</a></div><div><br></div><div>Another one would be a player process I've got for Process Quest: <a href="http://learnyousomeerlang.com/static/erlang/processquest/apps/processquest-1.0.0/src/pq_player.erl">http://learnyousomeerlang.com/static/erlang/processquest/apps/processquest-1.0.0/src/pq_player.erl</a> that one is a bit weird because it's a standalone process that sends itself the events it needs to move forward.</div>

<div><br></div><div>While there's no doubt it would be possible to do with a gen_server, I doubt it would be much cleaner or easier to read or as self-descriptive written that way. Using a gen_fsm makes it more obvious how the process is supposed to behave, in my opinion. </div>

<div><br></div><div>On Wed, Dec 7, 2011 at 4:40 AM, Max Lapshin <span dir="ltr"><<a href="mailto:max.lapshin@gmail.com">max.lapshin@gmail.com</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br> 
</div>It is exactly what Treskin was talking about. Show example of code,<br>
which is better built on gen_fsm, than on gen_server.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote>