public interface NextSingleRequestProxyResponseBuilderStep<BUILDER extends NextSingleRequestProxyResponseBuilderStep<BUILDER,ReqT,RespT>,ReqT,RespT> extends BuilderStep, MethodStubBuilder<ReqT,RespT>
| Modifier and Type | Method and Description |
|---|---|
BUILDER |
nextWillProxyTo(BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
Defines a proxying response, which will proxy the request to given
Response for
subsequent request call to this stub. |
default BUILDER |
nextWillReturn(Function<ReqT,RespT> responseFunction)
Defines a proxying response for subsequent request call to this stub, which is built based on received request.
|
buildBUILDER nextWillProxyTo(@Nonnull BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
Defines a proxying response, which will proxy the request to given Response for
subsequent request call to this stub. The user is responsible that the request is completed correctly.
Should be used when there needs to be more logic in the response method than returning a
simple response.
For example:
.nextWillProxyTo((request, responseObserver) -> {
responseObserver.onNext(responseObject);
responseObserver.onCompleted();
});
Copyright © 2023. All rights reserved.