[erlang-questions] gen_server vs gen_fsm

YC yinso.chen@REDACTED
Mon Oct 8 10:30:25 CEST 2007


Hi all -

I have a few newbie questions regarding gen_server and gen_fsm - I couldn't
find the answers easily though I'm sure they exists somewhere; would
appreciate pointers and sharing of experiences in designs :)

* are gen_fsm also a "server"?  It seems like gen_fsm is used to manage a
process that have multiple stages to fulfill its job, where gen_server by
and large has only one state, is that correct?  If not, what are the
differences?

* when should one use gen_fsm?  and when should one use a gen_server?

* I've read that the best way to handle multiple requests is to use
{noreply, State} in conjunction to spawn worker processes to handle the
request - should the worker process also be gen_server or gen_fsm?  For
example, what should a web server's worker process be?

* what's a good way to test the spawning to make it that it works?  I mean,
are there available tools to simplify the process?

Thanks very much,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071008/342638a3/attachment.htm>


More information about the erlang-questions mailing list