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

黃耀賢 (Yau-Hsien Huang) g9414002.pccu.edu.tw@REDACTED
Mon Jul 16 17:38:30 CEST 2018


gen_server:call/2 performs synchronous approach, while gen_server:cast/2,
asynchronous approach.

On Mon, Jul 16, 2018 at 11:18 PM, T Ty <tty.erlang@REDACTED> wrote:

> 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
>>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>


-- 

Best Regards.

--- Y-H. H.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180716/e07b8b99/attachment.htm>


More information about the erlang-questions mailing list