DEV Community

Discussion on: ELI5: Remote Procedure calls

Collapse
 
kspeakman profile image
Kasey Speakman

Classic RPC allows the client to use remote code as though it were local code.

// client code
Api.DoSomething();

Theoretically, the client does not need to know whether the code runs locally or the request is transmitted and executed on the server. Although it may be unwise to actually ignore that consideration.

Collapse
 
aafrey profile image
aafrey

Thanks Kasey. So say I wrap a simple HTTP request library to hit an API somewher, so that it looks like I'm just running local functions or methods in my program, does that count as an RPC?

Collapse
 
kspeakman profile image
Kasey Speakman • Edited

It could be. Traditionally, RPC means that when I call a procedure on the client, it is a stand-in for the same method on a remote machine. When I call Api.Something() on the client, then Something() is to be called on the server. (I should have made that more clear in my original answer.) HTTP could be used as the transport mechanism, but (unlike REST) that is not emphasized.