<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Assuming you have the 2 layers in separate Erlang VMs. You can have
the Erlang VMs connected with distributed Erlang, and have the twin
processes monitoring each other. If you wanted a simple process
death if either died, you could consider using a link instead of 2
monitors. However, that seems like the simplest solution, to avoid
unnecessary complexity. You might find strangeness if you start not
using the default net tick time (i.e., with a process link inbetween
nodes), with distributed Erlang, but you probably know it is best to
not play with that.<br>
<br>
On 09/14/2012 03:27 PM, Roberto Ostinelli wrote:
<blockquote
cite="mid:CAM5fRyr7hLPdwWjB-E+3fzKbFkHtgYX9o1Tp4kF_ums3L+R-3g@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html;
charset=ISO-8859-1">
Dear list,
<div><br>
</div>
<div>I have a 2-layer architecture where:</div>
<div>
<ul>
<li>the first layer is handling the socket connections to the
outside world clients</li>
<li>the second layer is performing computations related to the
connected clients (i.e. the core application)</li>
</ul>
<div>It is built in this way so that we can make the socket
handlers very stupid. Therefore, crashes on the first layer
are less likely to occur, and in case of crashes of the second
layer (the core application) we don't have all the clients
trying to reconnect at the same time: they'll still be
connected (even though receiving a 'service unavailable'
message of some kind).</div>
</div>
<div><br>
</div>
<div>For every single process handling a socket connection on the
first layer I therefore need to have a 'twin' process on the
second layer, strictly connected to its socket manager
counterpart.</div>
<div><br>
</div>
<div>I'm fishing for best practices here:</div>
<div>
<ul>
<li>how can I assure that if the second layer goes down (VM
crash, server hit by an angry sysadmin), the first layer
socket processes know that their twin process is down (and
the other way around)?</li>
<li>what is the best way to handle the creation of the twin
processes?</li>
</ul>
<div>Any input welcome. ^^_</div>
</div>
<div><br>
</div>
<div>r.</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>