[erlang-questions] gen_server:cast/call and {via, Module, ViaName}

T Ty tty.erlang@REDACTED
Mon Jul 16 17:18:13 CEST 2018


gen:call uses erlang:send/2 after finding the pid() using the via tuple.

Where else for gen_server:cast (line 224) it uses the ViaModule:send/2
function instead of erlang:send/2


On Mon, Jul 16, 2018 at 3:43 PM, Loïc Hoguin <essen@REDACTED> wrote:

> gen_server:call/2 calls gen:call which handles the via tuple.
>
>
> On 07/16/2018 04:38 PM, T Ty wrote:
>
>> Hello,
>>
>> 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.
>>
>> Was this intentional ?
>>
>> Thanks
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
> --
> Loïc Hoguin
> https://ninenines.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180716/4d20bcb3/attachment.htm>


More information about the erlang-questions mailing list