<div dir="ltr"><div><div>This section in the erlang documentation gives some explanation and examples:<br><br><a href="http://www.erlang.org/doc/design_principles/spec_proc.html">http://www.erlang.org/doc/design_principles/spec_proc.html</a><br>
<br></div>You do have to careful and follow the rules, but it is surprisingly simple. Note that this does not give you a behaviour "just" a process which fits into the OTP environment, for example it will work as it should in supervision trees.<br>
<br></div>Robert<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 February 2014 10:38, <span dir="ltr"><<a href="mailto:ludovic@demblans.com" target="_blank">ludovic@demblans.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Hi,<br>
<br>
Thank you for yours answers. With timer:no_diff/ is quite easy to handle "selective timeout" in a gen server so okay it could be a decent solution. The only problem is to have code to handle it in every callback that reset the timeout, this is okay. But I would not use a gen_fsm, because if you look at my first implementation, when there's no client the messages that are NOT {set_client, ...} are not discarded, they are stacked in the process mailbox for later use and this is expected.<br>
<br>
<br>
<br>
Le 2014-02-17 10:11, Anthony Ramine a écrit :<div class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You don’t have to reimplement ‘gen’ to implement a sys process, no.<br>
</blockquote>
<br>
<br></div>
As i may need to implement several processes with this kind of "client presence enforcement", implementing a sys process could be worth trying. (Plus i'll learn a lot). Have you got any link to a good tutorial/guide ?<br>
<br>
Thanks<br>
<br>
-- lud<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>