GRPCInterceptor.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2019 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
116 #import "GRPCCall.h"
117 #import "GRPCDispatchable.h"
118 
119 NS_ASSUME_NONNULL_BEGIN
120 
122 @class GRPCInterceptor;
123 @class GRPCRequestOptions;
124 @class GRPCCallOptions;
125 @protocol GRPCResponseHandler;
126 
131 
135 - (void)startWithRequestOptions:(GRPCRequestOptions *)requestOptions
136  callOptions:(GRPCCallOptions *)callOptions;
137 
141 - (void)writeData:(id)data;
142 
146 - (void)finish;
147 
151 - (void)cancel;
152 
156 - (void)receiveNextMessages:(NSUInteger)numberOfMessages;
157 
158 @end
159 
165 
170 - (GRPCInterceptor *)createInterceptorWithManager:(GRPCInterceptorManager *)interceptorManager;
171 
172 @end
173 
188 
189 - (instancetype)init NS_UNAVAILABLE;
190 
191 + (instancetype)new NS_UNAVAILABLE;
192 
193 - (nullable instancetype)initWithFactories:(nullable NSArray<id<GRPCInterceptorFactory>> *)factories
194  previousInterceptor:(nullable id<GRPCResponseHandler>)previousInterceptor
195  transportID:(GRPCTransportID)transportID;
196 
201 - (void)shutDown;
202 
203 // Methods to forward GRPCInterceptorInterface calls to the next interceptor
204 
206 - (void)startNextInterceptorWithRequest:(GRPCRequestOptions *)requestOptions
207  callOptions:(GRPCCallOptions *)callOptions;
208 
210 - (void)writeNextInterceptorWithData:(id)data;
211 
213 - (void)finishNextInterceptor;
214 
216 - (void)cancelNextInterceptor;
217 
219 - (void)receiveNextInterceptorMessages:(NSUInteger)numberOfMessages;
220 
221 // Methods to forward GRPCResponseHandler callbacks to the previous object
222 
224 - (void)forwardPreviousInterceptorWithInitialMetadata:(nullable NSDictionary *)initialMetadata;
225 
227 - (void)forwardPreviousInterceptorWithData:(nullable id)data;
228 
230 - (void)forwardPreviousInterceptorCloseWithTrailingMetadata:
231  (nullable NSDictionary *)trailingMetadata
232  error:(nullable NSError *)error;
233 
236 
237 @end
238 
250 
251 - (instancetype)init NS_UNAVAILABLE;
252 + (instancetype)new NS_UNAVAILABLE;
253 
258 - (nullable instancetype)initWithInterceptorManager:(GRPCInterceptorManager *)interceptorManager
259  dispatchQueue:(dispatch_queue_t)dispatchQueue;
260 
261 // Default implementation of GRPCInterceptorInterface
262 
263 - (void)startWithRequestOptions:(GRPCRequestOptions *)requestOptions
264  callOptions:(GRPCCallOptions *)callOptions;
265 - (void)writeData:(id)data;
266 - (void)finish;
267 - (void)cancel;
268 - (void)receiveNextMessages:(NSUInteger)numberOfMessages;
269 
270 // Default implementation of GRPCResponeHandler
271 
272 - (void)didReceiveInitialMetadata:(nullable NSDictionary *)initialMetadata;
273 - (void)didReceiveData:(id)data;
274 - (void)didCloseWithTrailingMetadata:(nullable NSDictionary *)trailingMetadata
275  error:(nullable NSError *)error;
276 - (void)didWriteData;
277 
278 @end
279 
280 NS_ASSUME_NONNULL_END
GRPCInterceptorManager
Definition: GRPCInterceptor.h:187
init
const char * init
Definition: upb/upb/bindings/lua/main.c:49
finish
static int finish(struct hexdump_ctx *ctx)
Definition: hexdump.c:148
GRPCCallOptions
Definition: GRPCCallOptions.h:32
-[GRPCInterceptor didWriteData]
void didWriteData()
GRPCInterceptorInterface-p
Definition: GRPCInterceptor.h:130
env.new
def new
Definition: env.py:51
-[GRPCInterceptorManager forwardPreviousInterceptorDidWriteData]
void forwardPreviousInterceptorDidWriteData()
GRPCInterceptorFactory-p
Definition: GRPCInterceptor.h:164
GRPCResponseHandler-p
Definition: GRPCCall.h:50
GRPCDispatchable-p
Definition: GRPCDispatchable.h:23
-[GRPCInterceptorManager finishNextInterceptor]
void finishNextInterceptor()
-[GRPCInterceptorManager cancelNextInterceptor]
void cancelNextInterceptor()
-[GRPCInterceptorManager shutDown]
void shutDown()
-[GRPCInterceptor NS_UNAVAILABLE]
instancetype NS_UNAVAILABLE()
GRPCDispatchable.h
GRPCRequestOptions
Definition: GRPCCall.h:102
GRPCTransportID
char *_Nonnull GRPCTransportID
Definition: GRPCTypes.h:174
cancel
bool cancel
Definition: client_callback_end2end_test.cc:634
-[GRPCInterceptorManager NS_UNAVAILABLE]
instancetype NS_UNAVAILABLE()
GRPCCall.h
GRPCInterceptor
Definition: GRPCInterceptor.h:249


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:48