Class ReplyStream
- java.lang.Object
-
- org.hansken.plugin.extraction.runtime.grpc.client.ReplyStream
-
public final class ReplyStream extends Object
A helper class to be used to send messages to the server. This helper class is required because we have to send replies to server requests, which is not supported out of the box by gRPC.
-
-
Constructor Summary
Constructors Constructor Description ReplyStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(io.grpc.stub.StreamObserver<com.google.protobuf.Any> other)Create a replier which communicates on a givenstream.voidonCompleted()Signal normal completion of the stream.voidonError(Throwable t)Signal erroneous completion of the stream.voidreply(com.google.protobuf.Any message)Send a message over the stream.
-
-
-
Method Detail
-
init
public void init(io.grpc.stub.StreamObserver<com.google.protobuf.Any> other)
Create a replier which communicates on a givenstream.- Parameters:
other- the stream to communicate on
-
reply
public void reply(com.google.protobuf.Any message)
Send a message over the stream.- Parameters:
message- the message to send- See Also:
StreamObserver.onNext(Object)
-
onCompleted
public void onCompleted()
Signal normal completion of the stream.- See Also:
StreamObserver.onCompleted()
-
onError
public void onError(Throwable t)
Signal erroneous completion of the stream.- Parameters:
t- the error cause- See Also:
StreamObserver.onError(Throwable)
-
-