[erlang-questions] Who called my gen_server?
Thu Apr 27 10:11:55 CEST 2017
----- On Apr 27, 2017, at 9:49 AM, Frank Muller <frank.muller.erl@REDACTED> wrote:
> Hi Andreas,
> No I didn't know that issue with "rpc".
> But is switching to a different solution as you mentioned (gproc, etc.) will
> help me solve "the who's calling me"?
Only for handle_call case. handle_cast and handle_info won't get that information. You have to include
the source in the actual message you are sending.
> Schultz< [ mailto:aschultz@REDACTED | aschultz@REDACTED ] > wrote :
>> ----- On Apr 24, 2017, at 5:43 PM, Frank Muller < [
>> mailto:frank.muller.erl@REDACTED | frank.muller.erl@REDACTED ] > wrote:
>>> Hi guys,
>>> I've two connected nodes: N1, N2.
>>> N1 is mine and I've a gen_server running on it.
>>> N2 is external and doesn't belong to me.
>>> A process on N2 is calling my gen_server (on N1) via an rpc:call.
>> You do know that the rpc server is exactly one process per Erlang
>> node. Pushing to many calls through it will degrade performance.
>> If you have any influence on the design of node N2, change it to call
>> your N1 gen_server directly without the intermediate rpc process.
>> You could either register your server with a global name, use another
>> global registry (e.g. gproc), or a myriad of other ways to reach your
>> gen_server without the rpc module.
>> That way, `From` in the handle_call method will contain the PID of
>> the caller.
>>> Is there a way to know the Pid of that process?
>>> Or, can I log all rpc_call(s) calling my gen_server?
>>> erlang-questions mailing list
>>> [ mailto:erlang-questions@REDACTED | erlang-questions@REDACTED ]
>>> [ http://erlang.org/mailman/listinfo/erlang-questions |
>>> http://erlang.org/mailman/listinfo/erlang-questions ]
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions