Hi - <br><br>Thanks for the quick response, please see inline. <br><br><div><span class="gmail_quote">On 10/8/07, <b class="gmail_sendername">Chandru</b> <<a href="mailto:chandrashekhar.mullaparthi@gmail.com">chandrashekhar.mullaparthi@gmail.com
</a>> wrote:<br></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> A gen_fsm helps you implement the logic for a finite state machine.
<br>> You can implement a FSM using gen_server but gen_fsm makes it much<br>> more easier and your code will be more structured and easier to read.<br><br>> > * when should one use gen_fsm? and when should one use a gen_server?
<br><br>> Use a gen_server when you want a long lived process which reacts to<br>> events. Use a gen_fsm to implement state machines. See<br>> <a href="http://en.wikipedia.org/wiki/Finite_state_machine">http://en.wikipedia.org/wiki/Finite_state_machine
</a></blockquote><div><br>When I think of state machine two primary types of example comes to mind:<br><br>1) the machine will generate the end result in one call as the input stream contains enough information to allow the machine to finish its processing; for example, a regular expression match
<br></div><br>2) the machine will reach its end state only after multiple calls as each call changes the state; for example, an e-commerce website.<br><br>Which type is gen_fsm suited for? To me, the 1st type is not a server, where the second type is, and hence my confusion about its suitability. As you say that gen_server is better suited for long lived processes, is gen_fsm not suited to implement the logic behind an e-commerce site?
<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> A web server's worker process doesn't have to be a gen_server or a<br>> gen_fsm. It just needs to be a module which given the HTTP request,
<br>> does some processing and returns some content to the HTTP client.</blockquote><div><br>I see. Are there disadvantages to use gen_server or gen_fsm in this case? Overkill?<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> > * what's a good way to test the spawning to make it that it works? I mean,<br>> > are there available tools to simplify the process?<br><br>> Sorry - I don't understand your question.</blockquote>
<div><br>Sorry - I simply meant to ask if there are tools within Erlang that would help with simulating load testings, such as the ab tool. <br></div><br>Thanks,<br>yc<br><br></div>