Skip to content

Commit

Permalink
Address some feedback from Idel and bring in test_services.proto to t…
Browse files Browse the repository at this point in the history
…est full scope of generation
  • Loading branch information
mgodave committed Nov 13, 2024
1 parent 0255ac5 commit 26b234b
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 181 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 'skipDeprecated=true'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Copyright © 2019 Apple Inc. and the ServiceTalk project authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

option java_multiple_files = true;
option java_package = "io.servicetalk.grpc.netty";
option java_outer_classname = "TesterProto";

package grpc.netty;

service Tester {
rpc test (TestRequest) returns (TestResponse) {}
rpc testBiDiStream (stream TestRequest) returns (stream TestResponse) {}
rpc testResponseStream (TestRequest) returns (stream TestResponse) {}
rpc testRequestStream (stream TestRequest) returns (TestResponse) {}
}

message TestRequest {
string name = 1;
}

message TestResponse {
string message = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ final Single<GrpcServerContext> bind(final ServerBinder binder, final GrpcExecut
* In case you have a use-case, let us know.
*/
@Deprecated
protected abstract void registerRoutes(Service service); // FIXME: 0.43 - remove deprecated method
protected void registerRoutes(Service service) { // FIXME: 0.43 - remove deprecated method
throw new UnsupportedOperationException("This method is not used starting from version 0.42.0");
}

/**
* Create a new {@link Service} from the passed {@link AllGrpcRoutes}.
Expand All @@ -150,7 +152,9 @@ final Single<GrpcServerContext> bind(final ServerBinder binder, final GrpcExecut
* In case you have a use-case, let us know.
*/
@Deprecated
protected abstract Service newServiceFromRoutes(AllGrpcRoutes routes); // FIXME: 0.43 - remove deprecated method
protected Service newServiceFromRoutes(AllGrpcRoutes routes) { // FIXME: 0.43 - remove deprecated method
throw new UnsupportedOperationException("This method is not used starting from version 0.42.0");
}

static GrpcRoutes<?> merge(GrpcRoutes<?>... allRoutes) {
final GrpcRouter.Builder[] builders = new GrpcRouter.Builder[allRoutes.length];
Expand Down
Loading

0 comments on commit 26b234b

Please sign in to comment.