<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I did some testing with your suggestions and would love to get some
feedback on what I did. <br>
The code is here at <a class="moz-txt-link-freetext" href="https://github.com/schnef/tst">https://github.com/schnef/tst</a>.<br>
<br>
Thanks,<br>
<br>
Frans<br>
<br>
<div class="moz-cite-prefix">On 01/27/2015 03:10 PM, Sean Cribbs
wrote:<br>
</div>
<blockquote
cite="mid:CAHsw=e3cDQdHvMU8yT0qZAmrQjD6jxoSuQ57X5Cm145yvHb8uw@mail.gmail.com"
type="cite">
<div dir="ltr">For those processes that are per-user, or otherwise
spin up and do some work and then go away, we use the
simple_one_for_one strategy in the supervisor. In your case, the
simple_one_for_one supervisor would start the master process of
the session (whether it be a supervisor or something else).</div>
</blockquote>
<blockquote
cite="mid:CAHsw=e3cDQdHvMU8yT0qZAmrQjD6jxoSuQ57X5Cm145yvHb8uw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>If the master process of the user session is a supervisor,
you can create whatever state is needed to be shared (an ETS
table perhaps, or maybe its own pid) and then pass it to the
children when starting. This supervisor would be a
one_for_one, one_for_all, or rest_for_one strategy, depending
on the dependencies between its children.</div>
</div>
</blockquote>
<blockquote
cite="mid:CAHsw=e3cDQdHvMU8yT0qZAmrQjD6jxoSuQ57X5Cm145yvHb8uw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>I wonder whether a single process per session will do (or
two, one for user connection and one for the proxy
connection), with different functionality being kept simply in
multiple modules rather than FSMs. For example, if your
connection process handling the TCP socket simply shuttles
data to and from, you might consider collapsing it into the
process that's next up the stack.</div>
</div>
</blockquote>
I would like to keep the process separate since each fulfills a very
specific function and their implementation is very clean now.
Merging modules would make them much harder to maintain / write /
understand. Also, using FSM's, especially for the crypt module turns
out to be very handy. The modules now are quite small but merging
them would make it one huge beast.<br>
<br>
<blockquote
cite="mid:CAHsw=e3cDQdHvMU8yT0qZAmrQjD6jxoSuQ57X5Cm145yvHb8uw@mail.gmail.com"
type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jan 27, 2015 at 6:14 AM, Imants
Cekusins <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:imantc@gmail.com" target="_blank">imantc@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">supervisors
are meant to supervise only afaik, not to store any state<br>
or do anything else.<br>
<div class="HOEnZb">
<div class="h5">_______________________________________________<br>
erlang-questions mailing list<br>
<a moz-do-not-send="true"
href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a moz-do-not-send="true"
href="http://erlang.org/mailman/listinfo/erlang-questions"
target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">Sean Cribbs <<a
moz-do-not-send="true" href="mailto:sean@basho.com"
target="_blank">sean@basho.com</a>><br>
Sr. Software Engineer<br>
Basho Technologies, Inc.<br>
<a moz-do-not-send="true" href="http://basho.com/"
target="_blank">http://basho.com/</a></div>
</div>
</blockquote>
<br>
</body>
</html>