Skip to content

Commit

Permalink
Address feedback from Idel
Browse files Browse the repository at this point in the history
  • Loading branch information
mgodave committed Nov 16, 2024
1 parent 050c0f1 commit ee093ac
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 86 deletions.
1 change: 1 addition & 0 deletions servicetalk-examples/grpc/protoc-options/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ protobuf {
outputSubDir = "java"
// Option to append a suffix to type names to avoid naming collisions with other code generation.
option 'typeNameSuffix=St'
// Option to tell the compiler to exclude all Deprecated fields, types, and methods from the output
option 'skipDeprecated=true'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1333,10 +1333,8 @@ protected interface BlockingStreamingRoute<Req, Resp>
* will be used.
*/
@Deprecated
default void handle(GrpcServiceContext ctx, BlockingIterable<Req> request, // FIXME: 0.43 - add default impl
GrpcPayloadWriter<Resp> responseWriter) throws Exception {
throw new UnsupportedOperationException("This method is not used starting from version 0.42.0");
}
void handle(GrpcServiceContext ctx, BlockingIterable<Req> request, // FIXME: 0.43 - add default impl
GrpcPayloadWriter<Resp> responseWriter) throws Exception;

/**
* Handles the passed {@link Req}.
Expand All @@ -1347,8 +1345,10 @@ default void handle(GrpcServiceContext ctx, BlockingIterable<Req> request, // F
* The implementation of this method is responsible for calling {@link GrpcPayloadWriter#close()}.
* @throws Exception If an exception occurs during request processing.
*/
void handle(GrpcServiceContext ctx, BlockingIterable<Req> request,
BlockingStreamingGrpcServerResponse<Resp> response) throws Exception;
default void handle(GrpcServiceContext ctx, BlockingIterable<Req> request, // FIXME: 0.43 - remove default impl
BlockingStreamingGrpcServerResponse<Resp> response) throws Exception {
handle(ctx, request, response.sendMetaData());
}

@Override
default void close() throws Exception {
Expand Down Expand Up @@ -1489,10 +1489,8 @@ protected interface BlockingResponseStreamingRoute<Req, Resp>
* implementation will be used.
*/
@Deprecated // FIXME: 0.43 - add default impl
default void handle(GrpcServiceContext ctx, Req request, GrpcPayloadWriter<Resp> responseWriter)
throws Exception {
throw new UnsupportedOperationException("This method is not used starting from version 0.42.0");
}
void handle(GrpcServiceContext ctx, Req request, GrpcPayloadWriter<Resp> responseWriter)
throws Exception;

/**
* Handles the passed {@link Req}.
Expand All @@ -1503,8 +1501,10 @@ default void handle(GrpcServiceContext ctx, Req request, GrpcPayloadWriter<Resp>
* The implementation of this method is responsible for calling {@link GrpcPayloadWriter#close()}.
* @throws Exception If an exception occurs during request processing.
*/
void handle(GrpcServiceContext ctx, Req request, // FIXME: 0.43 - remove default impl
BlockingStreamingGrpcServerResponse<Resp> response) throws Exception;
default void handle(GrpcServiceContext ctx, Req request, // FIXME: 0.43 - remove default impl
BlockingStreamingGrpcServerResponse<Resp> response) throws Exception {
handle(ctx, request, response.sendMetaData());
}

@Override
default void close() throws Exception {
Expand Down
Loading

0 comments on commit ee093ac

Please sign in to comment.