public interface SingleRequestProxyResponseBuilderStep<BUILDER extends BuilderStep,ReqT,RespT> extends BuilderStep, MethodStubBuilder<ReqT,RespT>
| Modifier and Type | Method and Description |
|---|---|
BUILDER |
willProxyTo(BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
Defines a proxying response, which will proxy the request to given
Response. |
default BUILDER |
willReturn(Function<ReqT,RespT> responseFunction)
Defines a proxying response, which is built based on received request.
|
buildBUILDER willProxyTo(@Nonnull BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
Defines a proxying response, which will proxy the request to given Response. 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:
.willProxyTo((request, responseObserver) -> {
responseObserver.onNext(responseObject);
responseObserver.onCompleted();
});
Copyright © 2023. All rights reserved.