Created
September 9, 2019 16:54
-
-
Save KKcorps/5911427b892d831f8f0981f3dcfac932 to your computer and use it in GitHub Desktop.
GreeterImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class GreeterImpl extends GreeterGrpc.GreeterImplBase { | |
@Override | |
public void sayHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) { | |
//Build Proto Messages Object | |
HelloReply reply = HelloReply.newBuilder().setMessage("Hello " + req.getName()).build(); | |
//Send the response, you can send multiple objects which will be trasmitted in streaming fashion | |
responseObserver.onNext(reply); | |
//Indicate client that response has finished | |
responseObserver.onCompleted(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment