[erlang-questions] Why RPC in Erlang? [was: How RPC works in erlang?]

Vans S vans_163@REDACTED
Thu Oct 5 21:37:25 CEST 2017


I agree here. I think RPC and gen_server calls which are the same thing really should not have been included/baked in. Instead there should of been a separate OTP behavior called async/wait or something.  This behavior can turn any async message into a sync procedure. 

Instead of doing  gen_server:call(name, {msg}), we do  {reply, AsyncAwait} = erlang:send(Pid, {self(), msg}, {reply, '_'}, 5000), what this means, send this message to the pid, and wait until a {reply, '_'} message comes, after 5000 ms timeout and error.   This way is much more generic, and simple. 

    On Thursday, October 5, 2017 1:55 PM, Brujo Benavides <elbrujohalcon@REDACTED> wrote:
 

 Hi Miles,
 I would go with: because someone needed it at some point. And now if you need it, too… you don’t have to reinvent it now. And to be super-precise (and a bit pedantic, I know): RPC is not in Erlang (i.e. in the VM), it comes (and is implemented using) OTP. In other words: it’s a tool built with the language, it’s not a part of the language like the basic architecture of message-passing concurrency.
 Cheers!

Brujo Benavides



On Oct 5, 2017, at 14:50, Miles Fidelman <mfidelman@REDACTED> wrote:
 
I guess an obvious question is why does Erlang have an RPC mechanism at all?  It's so at odds with the basic architecture of message-passing concurrency.Miles Fidelman
  
 On 10/5/17 3:02 AM, Brujo Benavides wrote:
  
Only for io, AFAIK.
  On Thu, 5 Oct 2017 at 01:51 Arun <arunp@REDACTED> wrote:
  
 Hi Brujo,Thanks for the information, but i have one more doubt; is this behavior only for io:format function calls or the execution of the entire function also will be happening in the host node. Regards,
 Arun P. 
 
 On Tuesday 03 October 2017 06:50 PM, Brujo Benavides wrote:
  
 Hi Arun, 
  That’s intended. It happens because of how Erlang redirects all IO through the process group_leader. This is the best explanatory link I could find googling quickly. Hope it helps.     Brujo Benavides      
 On Oct 3, 2017, at 10:10, Arun <arunp@REDACTED> wrote:  Hi all, I have two distributed applications running on two different nodes. And from one node I tried to call the function on the remote node by doing RPC, and its been observed that all the debug prints given in the application running on the  remote node is getting printed on the host node's console. Can somebody please tell me in detail why this is happening and how the RPC in erlang works. ? Thanks in advance. Arun P. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions   
   
  
  -- 
   elbrujohalcon @ iPhone  
  
 _______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions
 
 
 -- 
In theory, there is no difference between theory and practice.
In practice, there is.  .... Yogi Berra _______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171005/1e4fe3c9/attachment.htm>


More information about the erlang-questions mailing list