[erlang-questions] Best way to handle multiple gen_server

Felipe Beline <>
Tue Feb 14 18:06:28 CET 2017


Hi,

My first question is: If I have a gen_server started by a Supervisor and
it's handling a request (but has several others waiting in the queue), then
it dies for some reason, and the supervisor restart it. Will the requests
in the queue be lost?

Other question is, if I want to create a process of this specific
gen_server for each request that I have(then it should run in "parallel"
several instances), but after each one finishes the execution and return
the calculated value, I want to it to terminate himself. How should be the
properly way to implement it?

Another doubt is, let's  say that several thousands os request is made at
same time, and it creates one instance of the server for each one, should
it be "ok" :)? Or  should  I create a limited amount of servers and then
distribute the requests over then? In this case the OTP pool should help me
?

Cheers, Felipe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170214/730cc2e1/attachment.html>


More information about the erlang-questions mailing list