@@ -86,16 +86,28 @@ extension GRPCCore.ServiceDescriptor {
8686@available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
8787internal protocol Echo_EchoStreamingServiceProtocol : GRPCCore . RegistrableRPCService {
8888 /// Immediately returns an echo of a request.
89- func get( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
89+ func get(
90+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
91+ context: GRPCCore . ServerContext
92+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
9093
9194 /// Splits a request into words and returns each word in a stream of messages.
92- func expand( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
95+ func expand(
96+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
97+ context: GRPCCore . ServerContext
98+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
9399
94100 /// Collects a stream of messages and returns them concatenated when the caller closes.
95- func collect( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
101+ func collect(
102+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
103+ context: GRPCCore . ServerContext
104+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
96105
97106 /// Streams back messages as they are received in an input stream.
98- func update( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
107+ func update(
108+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
109+ context: GRPCCore . ServerContext
110+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
99111}
100112
101113/// Conformance to `GRPCCore.RegistrableRPCService`.
@@ -107,32 +119,44 @@ extension Echo_Echo.StreamingServiceProtocol {
107119 forMethod: Echo_Echo . Method. Get. descriptor,
108120 deserializer: GRPCProtobuf . ProtobufDeserializer < Echo_EchoRequest > ( ) ,
109121 serializer: GRPCProtobuf . ProtobufSerializer < Echo_EchoResponse > ( ) ,
110- handler: { request in
111- try await self . get ( request: request)
122+ handler: { request, context in
123+ try await self . get (
124+ request: request,
125+ context: context
126+ )
112127 }
113128 )
114129 router. registerHandler (
115130 forMethod: Echo_Echo . Method. Expand. descriptor,
116131 deserializer: GRPCProtobuf . ProtobufDeserializer < Echo_EchoRequest > ( ) ,
117132 serializer: GRPCProtobuf . ProtobufSerializer < Echo_EchoResponse > ( ) ,
118- handler: { request in
119- try await self . expand ( request: request)
133+ handler: { request, context in
134+ try await self . expand (
135+ request: request,
136+ context: context
137+ )
120138 }
121139 )
122140 router. registerHandler (
123141 forMethod: Echo_Echo . Method. Collect. descriptor,
124142 deserializer: GRPCProtobuf . ProtobufDeserializer < Echo_EchoRequest > ( ) ,
125143 serializer: GRPCProtobuf . ProtobufSerializer < Echo_EchoResponse > ( ) ,
126- handler: { request in
127- try await self . collect ( request: request)
144+ handler: { request, context in
145+ try await self . collect (
146+ request: request,
147+ context: context
148+ )
128149 }
129150 )
130151 router. registerHandler (
131152 forMethod: Echo_Echo . Method. Update. descriptor,
132153 deserializer: GRPCProtobuf . ProtobufDeserializer < Echo_EchoRequest > ( ) ,
133154 serializer: GRPCProtobuf . ProtobufSerializer < Echo_EchoResponse > ( ) ,
134- handler: { request in
135- try await self . update ( request: request)
155+ handler: { request, context in
156+ try await self . update (
157+ request: request,
158+ context: context
159+ )
136160 }
137161 )
138162 }
@@ -141,33 +165,63 @@ extension Echo_Echo.StreamingServiceProtocol {
141165@available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
142166internal protocol Echo_EchoServiceProtocol : Echo_Echo . StreamingServiceProtocol {
143167 /// Immediately returns an echo of a request.
144- func get( request: GRPCCore . ServerRequest . Single < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Single < Echo_EchoResponse >
168+ func get(
169+ request: GRPCCore . ServerRequest . Single < Echo_EchoRequest > ,
170+ context: GRPCCore . ServerContext
171+ ) async throws -> GRPCCore . ServerResponse . Single < Echo_EchoResponse >
145172
146173 /// Splits a request into words and returns each word in a stream of messages.
147- func expand( request: GRPCCore . ServerRequest . Single < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
174+ func expand(
175+ request: GRPCCore . ServerRequest . Single < Echo_EchoRequest > ,
176+ context: GRPCCore . ServerContext
177+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
148178
149179 /// Collects a stream of messages and returns them concatenated when the caller closes.
150- func collect( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Single < Echo_EchoResponse >
180+ func collect(
181+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
182+ context: GRPCCore . ServerContext
183+ ) async throws -> GRPCCore . ServerResponse . Single < Echo_EchoResponse >
151184
152185 /// Streams back messages as they are received in an input stream.
153- func update( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
186+ func update(
187+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
188+ context: GRPCCore . ServerContext
189+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse >
154190}
155191
156192/// Partial conformance to `Echo_EchoStreamingServiceProtocol`.
157193@available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
158194extension Echo_Echo . ServiceProtocol {
159- internal func get( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse > {
160- let response = try await self . get ( request: GRPCCore . ServerRequest. Single ( stream: request) )
195+ internal func get(
196+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
197+ context: GRPCCore . ServerContext
198+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse > {
199+ let response = try await self . get (
200+ request: GRPCCore . ServerRequest. Single ( stream: request) ,
201+ context: context
202+ )
161203 return GRPCCore . ServerResponse. Stream ( single: response)
162204 }
163205
164- internal func expand( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse > {
165- let response = try await self . expand ( request: GRPCCore . ServerRequest. Single ( stream: request) )
206+ internal func expand(
207+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
208+ context: GRPCCore . ServerContext
209+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse > {
210+ let response = try await self . expand (
211+ request: GRPCCore . ServerRequest. Single ( stream: request) ,
212+ context: context
213+ )
166214 return response
167215 }
168216
169- internal func collect( request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse > {
170- let response = try await self . collect ( request: request)
217+ internal func collect(
218+ request: GRPCCore . ServerRequest . Stream < Echo_EchoRequest > ,
219+ context: GRPCCore . ServerContext
220+ ) async throws -> GRPCCore . ServerResponse . Stream < Echo_EchoResponse > {
221+ let response = try await self . collect (
222+ request: request,
223+ context: context
224+ )
171225 return GRPCCore . ServerResponse. Stream ( single: response)
172226 }
173227}
0 commit comments