Abstract interface for an RPC channel. An {@code RpcChannel} represents acommunication line to a {@link Service} which can be used to call that{@link Service}'s methods. The {@link Service} may be running on anothermachine. Normally, you should not call an {@code RpcChannel} directly, butinstead construct a stub {@link Service} wrapping it. Example:
RpcChannel channel = rpcImpl.newChannel("remotehost.example.com:1234"); RpcController controller = rpcImpl.newController(); MyService service = MyService.newStub(channel); service.myMethod(controller, request, callback);
Starting with version 2.3.0, RPC implementations should not try to build on this, but should instead provide code generator plugins which generate code specific to the particular RPC implementation. This way the generated code can be more appropriate for the implementation in use and can avoid unnecessary layers of indirection. @author kenton@google.com Kenton Varda
|
|
|
|
|
|