| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554 |
- // Copyright 2015 gRPC 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.
- /// An integration test service that covers all the method signature permutations
- /// of unary/streaming requests/responses.
- // DO NOT EDIT.
- // swift-format-ignore-file
- //
- // Generated by the gRPC Swift generator plugin for the protocol buffer compiler.
- // Source: grpc/testing/benchmark_service.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/grpc/grpc-swift
- internal import GRPCCore
- internal import GRPCProtobuf
- internal enum Grpc_Testing_BenchmarkService {
- internal static let descriptor = ServiceDescriptor.grpc_testing_BenchmarkService
- internal enum Method {
- internal enum UnaryCall {
- internal typealias Input = Grpc_Testing_SimpleRequest
- internal typealias Output = Grpc_Testing_SimpleResponse
- internal static let descriptor = MethodDescriptor(
- service: Grpc_Testing_BenchmarkService.descriptor.fullyQualifiedService,
- method: "UnaryCall"
- )
- }
- internal enum StreamingCall {
- internal typealias Input = Grpc_Testing_SimpleRequest
- internal typealias Output = Grpc_Testing_SimpleResponse
- internal static let descriptor = MethodDescriptor(
- service: Grpc_Testing_BenchmarkService.descriptor.fullyQualifiedService,
- method: "StreamingCall"
- )
- }
- internal enum StreamingFromClient {
- internal typealias Input = Grpc_Testing_SimpleRequest
- internal typealias Output = Grpc_Testing_SimpleResponse
- internal static let descriptor = MethodDescriptor(
- service: Grpc_Testing_BenchmarkService.descriptor.fullyQualifiedService,
- method: "StreamingFromClient"
- )
- }
- internal enum StreamingFromServer {
- internal typealias Input = Grpc_Testing_SimpleRequest
- internal typealias Output = Grpc_Testing_SimpleResponse
- internal static let descriptor = MethodDescriptor(
- service: Grpc_Testing_BenchmarkService.descriptor.fullyQualifiedService,
- method: "StreamingFromServer"
- )
- }
- internal enum StreamingBothWays {
- internal typealias Input = Grpc_Testing_SimpleRequest
- internal typealias Output = Grpc_Testing_SimpleResponse
- internal static let descriptor = MethodDescriptor(
- service: Grpc_Testing_BenchmarkService.descriptor.fullyQualifiedService,
- method: "StreamingBothWays"
- )
- }
- internal static let descriptors: [MethodDescriptor] = [
- UnaryCall.descriptor,
- StreamingCall.descriptor,
- StreamingFromClient.descriptor,
- StreamingFromServer.descriptor,
- StreamingBothWays.descriptor
- ]
- }
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal typealias StreamingServiceProtocol = Grpc_Testing_BenchmarkServiceStreamingServiceProtocol
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal typealias ServiceProtocol = Grpc_Testing_BenchmarkServiceServiceProtocol
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal typealias ClientProtocol = Grpc_Testing_BenchmarkServiceClientProtocol
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal typealias Client = Grpc_Testing_BenchmarkServiceClient
- }
- extension ServiceDescriptor {
- internal static let grpc_testing_BenchmarkService = Self(
- package: "grpc.testing",
- service: "BenchmarkService"
- )
- }
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal protocol Grpc_Testing_BenchmarkServiceStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
- /// One request followed by one response.
- /// The server returns the client payload as-is.
- func unaryCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
-
- /// Repeated sequence of one request followed by one response.
- /// Should be called streaming ping-pong
- /// The server returns the client payload as-is on each response
- func streamingCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
-
- /// Single-sided unbounded streaming from client to server
- /// The server returns the client payload as-is once the client does WritesDone
- func streamingFromClient(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
-
- /// Single-sided unbounded streaming from server to client
- /// The server repeatedly returns the client payload as-is
- func streamingFromServer(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
-
- /// Two-sided unbounded streaming between server to client
- /// Both sides send the content of their own choice to the other
- func streamingBothWays(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
- }
- /// Conformance to `GRPCCore.RegistrableRPCService`.
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- extension Grpc_Testing_BenchmarkService.StreamingServiceProtocol {
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal func registerMethods(with router: inout GRPCCore.RPCRouter) {
- router.registerHandler(
- forMethod: Grpc_Testing_BenchmarkService.Method.UnaryCall.descriptor,
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- serializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- handler: { request in
- try await self.unaryCall(request: request)
- }
- )
- router.registerHandler(
- forMethod: Grpc_Testing_BenchmarkService.Method.StreamingCall.descriptor,
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- serializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- handler: { request in
- try await self.streamingCall(request: request)
- }
- )
- router.registerHandler(
- forMethod: Grpc_Testing_BenchmarkService.Method.StreamingFromClient.descriptor,
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- serializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- handler: { request in
- try await self.streamingFromClient(request: request)
- }
- )
- router.registerHandler(
- forMethod: Grpc_Testing_BenchmarkService.Method.StreamingFromServer.descriptor,
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- serializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- handler: { request in
- try await self.streamingFromServer(request: request)
- }
- )
- router.registerHandler(
- forMethod: Grpc_Testing_BenchmarkService.Method.StreamingBothWays.descriptor,
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- serializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- handler: { request in
- try await self.streamingBothWays(request: request)
- }
- )
- }
- }
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal protocol Grpc_Testing_BenchmarkServiceServiceProtocol: Grpc_Testing_BenchmarkService.StreamingServiceProtocol {
- /// One request followed by one response.
- /// The server returns the client payload as-is.
- func unaryCall(request: ServerRequest.Single<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Single<Grpc_Testing_SimpleResponse>
-
- /// Repeated sequence of one request followed by one response.
- /// Should be called streaming ping-pong
- /// The server returns the client payload as-is on each response
- func streamingCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
-
- /// Single-sided unbounded streaming from client to server
- /// The server returns the client payload as-is once the client does WritesDone
- func streamingFromClient(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Single<Grpc_Testing_SimpleResponse>
-
- /// Single-sided unbounded streaming from server to client
- /// The server repeatedly returns the client payload as-is
- func streamingFromServer(request: ServerRequest.Single<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
-
- /// Two-sided unbounded streaming between server to client
- /// Both sides send the content of their own choice to the other
- func streamingBothWays(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
- }
- /// Partial conformance to `Grpc_Testing_BenchmarkServiceStreamingServiceProtocol`.
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- extension Grpc_Testing_BenchmarkService.ServiceProtocol {
- internal func unaryCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
- let response = try await self.unaryCall(request: ServerRequest.Single(stream: request))
- return ServerResponse.Stream(single: response)
- }
-
- internal func streamingFromClient(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
- let response = try await self.streamingFromClient(request: request)
- return ServerResponse.Stream(single: response)
- }
-
- internal func streamingFromServer(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
- let response = try await self.streamingFromServer(request: ServerRequest.Single(stream: request))
- return response
- }
- }
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal protocol Grpc_Testing_BenchmarkServiceClientProtocol: Sendable {
- /// One request followed by one response.
- /// The server returns the client payload as-is.
- func unaryCall<R>(
- request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions,
- _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable
-
- /// Repeated sequence of one request followed by one response.
- /// Should be called streaming ping-pong
- /// The server returns the client payload as-is on each response
- func streamingCall<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable
-
- /// Single-sided unbounded streaming from client to server
- /// The server returns the client payload as-is once the client does WritesDone
- func streamingFromClient<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions,
- _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable
-
- /// Single-sided unbounded streaming from server to client
- /// The server repeatedly returns the client payload as-is
- func streamingFromServer<R>(
- request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable
-
- /// Two-sided unbounded streaming between server to client
- /// Both sides send the content of their own choice to the other
- func streamingBothWays<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable
- }
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- extension Grpc_Testing_BenchmarkService.ClientProtocol {
- internal func unaryCall<R>(
- request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R = {
- try $0.message
- }
- ) async throws -> R where R: Sendable {
- try await self.unaryCall(
- request: request,
- serializer: ProtobufSerializer<Grpc_Testing_SimpleRequest>(),
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleResponse>(),
- options: options,
- body
- )
- }
-
- internal func streamingCall<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable {
- try await self.streamingCall(
- request: request,
- serializer: ProtobufSerializer<Grpc_Testing_SimpleRequest>(),
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleResponse>(),
- options: options,
- body
- )
- }
-
- internal func streamingFromClient<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R = {
- try $0.message
- }
- ) async throws -> R where R: Sendable {
- try await self.streamingFromClient(
- request: request,
- serializer: ProtobufSerializer<Grpc_Testing_SimpleRequest>(),
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleResponse>(),
- options: options,
- body
- )
- }
-
- internal func streamingFromServer<R>(
- request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable {
- try await self.streamingFromServer(
- request: request,
- serializer: ProtobufSerializer<Grpc_Testing_SimpleRequest>(),
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleResponse>(),
- options: options,
- body
- )
- }
-
- internal func streamingBothWays<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable {
- try await self.streamingBothWays(
- request: request,
- serializer: ProtobufSerializer<Grpc_Testing_SimpleRequest>(),
- deserializer: ProtobufDeserializer<Grpc_Testing_SimpleResponse>(),
- options: options,
- body
- )
- }
- }
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- extension Grpc_Testing_BenchmarkService.ClientProtocol {
- /// One request followed by one response.
- /// The server returns the client payload as-is.
- internal func unaryCall<Result>(
- _ message: Grpc_Testing_SimpleRequest,
- metadata: GRPCCore.Metadata = [:],
- options: GRPCCore.CallOptions = .defaults,
- onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> Result = {
- try $0.message
- }
- ) async throws -> Result where Result: Sendable {
- let request = GRPCCore.ClientRequest.Single<Grpc_Testing_SimpleRequest>(
- message: message,
- metadata: metadata
- )
- return try await self.unaryCall(
- request: request,
- options: options,
- handleResponse
- )
- }
-
- /// Repeated sequence of one request followed by one response.
- /// Should be called streaming ping-pong
- /// The server returns the client payload as-is on each response
- internal func streamingCall<Result>(
- metadata: GRPCCore.Metadata = [:],
- options: GRPCCore.CallOptions = .defaults,
- requestProducer: @Sendable @escaping (GRPCCore.RPCWriter<Grpc_Testing_SimpleRequest>) async throws -> Void,
- onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> Result
- ) async throws -> Result where Result: Sendable {
- let request = GRPCCore.ClientRequest.Stream<Grpc_Testing_SimpleRequest>(
- metadata: metadata,
- producer: requestProducer
- )
- return try await self.streamingCall(
- request: request,
- options: options,
- handleResponse
- )
- }
-
- /// Single-sided unbounded streaming from client to server
- /// The server returns the client payload as-is once the client does WritesDone
- internal func streamingFromClient<Result>(
- metadata: GRPCCore.Metadata = [:],
- options: GRPCCore.CallOptions = .defaults,
- requestProducer: @Sendable @escaping (GRPCCore.RPCWriter<Grpc_Testing_SimpleRequest>) async throws -> Void,
- onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> Result = {
- try $0.message
- }
- ) async throws -> Result where Result: Sendable {
- let request = GRPCCore.ClientRequest.Stream<Grpc_Testing_SimpleRequest>(
- metadata: metadata,
- producer: requestProducer
- )
- return try await self.streamingFromClient(
- request: request,
- options: options,
- handleResponse
- )
- }
-
- /// Single-sided unbounded streaming from server to client
- /// The server repeatedly returns the client payload as-is
- internal func streamingFromServer<Result>(
- _ message: Grpc_Testing_SimpleRequest,
- metadata: GRPCCore.Metadata = [:],
- options: GRPCCore.CallOptions = .defaults,
- onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> Result
- ) async throws -> Result where Result: Sendable {
- let request = GRPCCore.ClientRequest.Single<Grpc_Testing_SimpleRequest>(
- message: message,
- metadata: metadata
- )
- return try await self.streamingFromServer(
- request: request,
- options: options,
- handleResponse
- )
- }
-
- /// Two-sided unbounded streaming between server to client
- /// Both sides send the content of their own choice to the other
- internal func streamingBothWays<Result>(
- metadata: GRPCCore.Metadata = [:],
- options: GRPCCore.CallOptions = .defaults,
- requestProducer: @Sendable @escaping (GRPCCore.RPCWriter<Grpc_Testing_SimpleRequest>) async throws -> Void,
- onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> Result
- ) async throws -> Result where Result: Sendable {
- let request = GRPCCore.ClientRequest.Stream<Grpc_Testing_SimpleRequest>(
- metadata: metadata,
- producer: requestProducer
- )
- return try await self.streamingBothWays(
- request: request,
- options: options,
- handleResponse
- )
- }
- }
- @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
- internal struct Grpc_Testing_BenchmarkServiceClient: Grpc_Testing_BenchmarkService.ClientProtocol {
- private let client: GRPCCore.GRPCClient
-
- internal init(wrapping client: GRPCCore.GRPCClient) {
- self.client = client
- }
-
- /// One request followed by one response.
- /// The server returns the client payload as-is.
- internal func unaryCall<R>(
- request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R = {
- try $0.message
- }
- ) async throws -> R where R: Sendable {
- try await self.client.unary(
- request: request,
- descriptor: Grpc_Testing_BenchmarkService.Method.UnaryCall.descriptor,
- serializer: serializer,
- deserializer: deserializer,
- options: options,
- handler: body
- )
- }
-
- /// Repeated sequence of one request followed by one response.
- /// Should be called streaming ping-pong
- /// The server returns the client payload as-is on each response
- internal func streamingCall<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable {
- try await self.client.bidirectionalStreaming(
- request: request,
- descriptor: Grpc_Testing_BenchmarkService.Method.StreamingCall.descriptor,
- serializer: serializer,
- deserializer: deserializer,
- options: options,
- handler: body
- )
- }
-
- /// Single-sided unbounded streaming from client to server
- /// The server returns the client payload as-is once the client does WritesDone
- internal func streamingFromClient<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R = {
- try $0.message
- }
- ) async throws -> R where R: Sendable {
- try await self.client.clientStreaming(
- request: request,
- descriptor: Grpc_Testing_BenchmarkService.Method.StreamingFromClient.descriptor,
- serializer: serializer,
- deserializer: deserializer,
- options: options,
- handler: body
- )
- }
-
- /// Single-sided unbounded streaming from server to client
- /// The server repeatedly returns the client payload as-is
- internal func streamingFromServer<R>(
- request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable {
- try await self.client.serverStreaming(
- request: request,
- descriptor: Grpc_Testing_BenchmarkService.Method.StreamingFromServer.descriptor,
- serializer: serializer,
- deserializer: deserializer,
- options: options,
- handler: body
- )
- }
-
- /// Two-sided unbounded streaming between server to client
- /// Both sides send the content of their own choice to the other
- internal func streamingBothWays<R>(
- request: ClientRequest.Stream<Grpc_Testing_SimpleRequest>,
- serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
- deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
- options: CallOptions = .defaults,
- _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_SimpleResponse>) async throws -> R
- ) async throws -> R where R: Sendable {
- try await self.client.bidirectionalStreaming(
- request: request,
- descriptor: Grpc_Testing_BenchmarkService.Method.StreamingBothWays.descriptor,
- serializer: serializer,
- deserializer: deserializer,
- options: options,
- handler: body
- )
- }
- }
|