<div dir="ltr"><div>Simply put what I was trying to achieve is the following: By using {via, ViaModule, Name} I was trying to trap the cast/calls to a gen_server and manipulate the outgoing message. If the message is "large" (based on the message tuple structure) I can push the message via a separate TCP socket mimicking a separation between data and command channel to avoid saturating the disterl pipe. <br><br></div>In any case I'll look at a different setup.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 16, 2018 at 4:38 PM, 黃耀賢 (Yau-Hsien Huang) <span dir="ltr"><<a href="mailto:g9414002.pccu.edu.tw@gmail.com" target="_blank">g9414002.pccu.edu.tw@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">gen_server:call/2 performs synchronous approach, while gen_server:cast/2, asynchronous approach.<br></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Mon, Jul 16, 2018 at 11:18 PM, T Ty <span dir="ltr"><<a href="mailto:tty.erlang@gmail.com" target="_blank">tty.erlang@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>gen:call uses erlang:send/2 after finding the pid() using the via tuple.<br><br></div>Where else for gen_server:cast (line 224) it uses the ViaModule:send/2 function instead of erlang:send/2<span><br><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 16, 2018 at 3:43 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">gen_server:call/2 calls gen:call which handles the via tuple.<div><div class="m_6386831569956416702m_-7934112668483795661h5"><br>
<br>
On 07/16/2018 04:38 PM, T Ty wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6386831569956416702m_-7934112668483795661h5">
Hello,<br>
<br>
Looking a the code I notice that a gen_server:cast({via, M, N}, Msg) would use M:send/2 but there does not seem to be a similar functionality for gen_server:call/2.<br>
<br>
Was this intentional ?<br>
<br>
Thanks<br>
<br>
<br></div></div>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
<br><span class="m_6386831569956416702m_-7934112668483795661HOEnZb"><font color="#888888">
</font></span></blockquote><span class="m_6386831569956416702m_-7934112668483795661HOEnZb"><font color="#888888">
<br>
-- <br>
Loïc Hoguin<br>
<a href="https://ninenines.eu" rel="noreferrer" target="_blank">https://ninenines.eu</a><br>
</font></span></blockquote></div><br></div></span></div>
<br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br></div></div><div class="m_6386831569956416702gmail_signature" data-smartmail="gmail_signature"><div><br></div>Best Regards.<span class="HOEnZb"><font color="#888888"><div><br></div><div>--- Y-H. H.</div><div><br></div></font></span></div>
</div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>