Skip to content

Commit 2e1dbed

Browse files
committed
Update generateed code and tests
Motivation: Some names chagned in grpc/grpc-swift#2076 so our generated code isn't up-to-date. Modifications: - Update names - Regenerate code Result: Tests and generated code are up-to-date
1 parent 337cad1 commit 2e1dbed

File tree

8 files changed

+188
-188
lines changed

8 files changed

+188
-188
lines changed

IntegrationTests/grpc-performance-tests/Sources/BenchmarkClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ final class BenchmarkClient: Sendable {
151151
private func unary(benchmark: Grpc_Testing_BenchmarkServiceClient) async {
152152
let (errorCode, nanoseconds): (RPCError.Code?, Double) = await self.timeIt {
153153
do {
154-
try await benchmark.unaryCall(request: ClientRequest.Single(message: self.message)) {
154+
try await benchmark.unaryCall(request: ClientRequest(message: self.message)) {
155155
_ = try $0.message
156156
}
157157
return nil
@@ -174,7 +174,7 @@ final class BenchmarkClient: Sendable {
174174
of: RPCAsyncSequence<Grpc_Testing_SimpleResponse, any Error>.self
175175
)
176176

177-
let request = ClientRequest.Stream(of: Grpc_Testing_SimpleRequest.self) { writer in
177+
let request = StreamingClientRequest(of: Grpc_Testing_SimpleRequest.self) { writer in
178178
defer { status.continuation.finish() }
179179

180180
// The time at which the last message was sent.

IntegrationTests/grpc-performance-tests/Sources/BenchmarkService.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
2626
/// One request followed by one response.
2727
/// The server returns a client payload with the size requested by the client.
2828
func unaryCall(
29-
request: ServerRequest.Single<Grpc_Testing_SimpleRequest>,
29+
request: ServerRequest<Grpc_Testing_SimpleRequest>,
3030
context: ServerContext
31-
) async throws -> ServerResponse.Single<Grpc_Testing_SimpleResponse> {
31+
) async throws -> ServerResponse<Grpc_Testing_SimpleResponse> {
3232
// Throw an error if the status is not `ok`. Otherwise, an `ok` status is automatically sent
3333
// if the request is successful.
3434
if request.message.responseStatus.isInitialized {
3535
try self.checkOkStatus(request.message.responseStatus)
3636
}
3737

38-
return ServerResponse.Single(
38+
return ServerResponse(
3939
message: .with {
4040
$0.payload = Grpc_Testing_Payload.with {
4141
$0.body = Data(count: Int(request.message.responseSize))
@@ -47,10 +47,10 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
4747
/// Repeated sequence of one request followed by one response.
4848
/// The server returns a payload with the size requested by the client for each received message.
4949
func streamingCall(
50-
request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>,
50+
request: StreamingServerRequest<Grpc_Testing_SimpleRequest>,
5151
context: ServerContext
52-
) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
53-
return ServerResponse.Stream { writer in
52+
) async throws -> StreamingServerResponse<Grpc_Testing_SimpleResponse> {
53+
return StreamingServerResponse { writer in
5454
for try await message in request.messages {
5555
if message.responseStatus.isInitialized {
5656
try self.checkOkStatus(message.responseStatus)
@@ -72,9 +72,9 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
7272
/// Single-sided unbounded streaming from client to server.
7373
/// The server returns a payload with the size requested by the client once the client does WritesDone.
7474
func streamingFromClient(
75-
request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>,
75+
request: StreamingServerRequest<Grpc_Testing_SimpleRequest>,
7676
context: ServerContext
77-
) async throws -> ServerResponse.Single<Grpc_Testing_SimpleResponse> {
77+
) async throws -> ServerResponse<Grpc_Testing_SimpleResponse> {
7878
var responseSize = 0
7979
for try await message in request.messages {
8080
if message.responseStatus.isInitialized {
@@ -83,7 +83,7 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
8383
responseSize = Int(message.responseSize)
8484
}
8585

86-
return ServerResponse.Single(
86+
return ServerResponse(
8787
message: .with {
8888
$0.payload = .with {
8989
$0.body = Data(count: responseSize)
@@ -95,9 +95,9 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
9595
/// Single-sided unbounded streaming from server to client.
9696
/// The server repeatedly returns a payload with the size requested by the client.
9797
func streamingFromServer(
98-
request: ServerRequest.Single<Grpc_Testing_SimpleRequest>,
98+
request: ServerRequest<Grpc_Testing_SimpleRequest>,
9999
context: ServerContext
100-
) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
100+
) async throws -> StreamingServerResponse<Grpc_Testing_SimpleResponse> {
101101
if request.message.responseStatus.isInitialized {
102102
try self.checkOkStatus(request.message.responseStatus)
103103
}
@@ -108,7 +108,7 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
108108
}
109109
}
110110

111-
return ServerResponse.Stream { writer in
111+
return StreamingServerResponse { writer in
112112
while self.working.load(ordering: .relaxed) {
113113
try await writer.write(response)
114114
}
@@ -119,9 +119,9 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
119119
/// Two-sided unbounded streaming between server to client.
120120
/// Both sides send the content of their own choice to the other.
121121
func streamingBothWays(
122-
request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>,
122+
request: StreamingServerRequest<Grpc_Testing_SimpleRequest>,
123123
context: ServerContext
124-
) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
124+
) async throws -> StreamingServerResponse<Grpc_Testing_SimpleResponse> {
125125
// The 100 size is used by the other implementations as well.
126126
// We are using the same canned response size for all responses
127127
// as it is allowed by the spec.
@@ -150,7 +150,7 @@ final class BenchmarkService: Grpc_Testing_BenchmarkService.ServiceProtocol {
150150
// Marks if the inbound streaming is ongoing or finished.
151151
let inbound = InboundStreamingSignal()
152152

153-
return ServerResponse.Stream { writer in
153+
return StreamingServerResponse { writer in
154154
try await withThrowingTaskGroup(of: Void.self) { group in
155155
group.addTask {
156156
for try await message in request.messages {

0 commit comments

Comments
 (0)