why
why

Reputation: 24851

What is the difference between Ports and RPC for Erlang?

They are both the method for erlang to communicate with the external world from Erlang's point of view

So what is the difference and which performance is better ?

Upvotes: 0

Views: 347

Answers (1)

Matthias
Matthias

Reputation: 8180

As the name suggests, rpc (remote procedure calls) is a construct to call a function on a remote node (and get the result).

A port (in Erlang) is simply a communication point, not even (necessarily) to a remote node. You use ports, e.g., to communicate with another (non-Erlang) program.

Both constructs are for different purposes. No one is better, they are simply different. If you want, rpc is at a higher abstraction level than ports, but that doesn't make it better or worse.

Upvotes: 2

Related Questions