Remote Procedure Call (RPC) is a computer communication protocol that allows the program running on one computer to call subprograms on another computer, without coding for remote interaction. In the object-oriented programming paradigm, RPC calls are represented by remote invocation or remote method invocation (RMI). In simple terms, RPC is a method to invoke a remote known procedure through the network. RPC is a design and concept, but not a specific technology. RPC involves three key points:
- Communication Protocol: Remote invocation requires the support of bottom-layer network communication protocols that can implement network transmission, for example, HTTP/TCP and even UDP.
- Coding Protocol: The client and server use streams to communicate with each other, so the serialization and deserialization processes are involved. The client and server must use the same serialization protocol.
- Method Mapping: To determine the method used by the client to invoke the remote server, the server (or a third-party service discovery center) must maintain a method list for service provision.
These three key points constitute a simple RPC frame. The Go Programming Language (Golang) maintains a simple RPC frame, of which the source code are located at src/net/rpc. Its implementation is simple:
from DZone.com Feed https://ift.tt/2Pgd3LJ
No comments:
Post a Comment