ReqT - type of the requestResT - type of the response@NotThreadSafe public class GrpcDataMessageBlockingStream<ReqT,ResT> extends GrpcBlockingStream<ReqT,ResT>
| Constructor and Description |
|---|
GrpcDataMessageBlockingStream(java.util.function.Function<io.grpc.stub.StreamObserver<ResT>,io.grpc.stub.StreamObserver<ReqT>> rpcFunc,
int bufferSize,
java.lang.String description,
DataMessageMarshaller<ReqT> requestMarshaller,
DataMessageMarshaller<ResT> responseMarshaller) |
| Modifier and Type | Method and Description |
|---|---|
ResT |
receive(long timeoutMs)
Receives a response from the server.
|
DataMessage<ResT,DataBuffer> |
receiveDataMessage(long timeoutMs)
Receives a response with data buffer from the server.
|
void |
sendDataMessage(DataMessage<ReqT,DataBuffer> message,
long timeoutMs)
Sends a request.
|
void |
waitForComplete(long timeoutMs)
Wait for server to complete the inbound stream.
|
cancel, close, isCanceled, isClosed, isOpen, send, sendpublic GrpcDataMessageBlockingStream(java.util.function.Function<io.grpc.stub.StreamObserver<ResT>,io.grpc.stub.StreamObserver<ReqT>> rpcFunc, int bufferSize, java.lang.String description, DataMessageMarshaller<ReqT> requestMarshaller, DataMessageMarshaller<ResT> responseMarshaller)
rpcFunc - the gRPC bi-directional stream stub functionbufferSize - maximum number of incoming messages the buffer can holddescription - description of this streamrequestMarshaller - the marshaller for the requestresponseMarshaller - the marshaller for the responsepublic ResT receive(long timeoutMs) throws java.io.IOException
GrpcBlockingStreamreceive in class GrpcBlockingStream<ReqT,ResT>timeoutMs - maximum time to wait before giving up and throwing
a DeadlineExceededExceptionjava.io.IOException - if any error occurspublic DataMessage<ResT,DataBuffer> receiveDataMessage(long timeoutMs) throws java.io.IOException
timeoutMs - maximum time to wait before giving up and throwing
a DeadlineExceededExceptionjava.io.IOException - if any error occurspublic void sendDataMessage(DataMessage<ReqT,DataBuffer> message, long timeoutMs) throws java.io.IOException
message - the request message with attachedtimeoutMs - maximum wait time before throwing a DeadlineExceededExceptionjava.io.IOException - if any error occurspublic void waitForComplete(long timeoutMs)
throws java.io.IOException
GrpcBlockingStreamwaitForComplete in class GrpcBlockingStream<ReqT,ResT>timeoutMs - maximum time to wait for server responsejava.io.IOExceptionCopyright © 2022. All Rights Reserved.