GRPC Objective-C
1.71.0
|
Base class for a gRPC interceptor. More...
#import <GRPCInterceptor.h>
Instance Methods | |
(instancetype) | - NS_UNAVAILABLE |
(nullable instancetype) | - initWithInterceptorManager:dispatchQueue: |
Initialize the interceptor with the next interceptor in the chain, and provide the dispatch queue that this interceptor's methods are dispatched onto. More... | |
(void) | - startWithRequestOptions:callOptions: |
To start the call. More... | |
(void) | - writeData: |
To write data to the call. More... | |
(void) | - finish |
To finish the stream of requests. More... | |
(void) | - cancel |
To cancel the call. More... | |
(void) | - receiveNextMessages: |
To indicate the call that the previous interceptor is ready to receive more messages. More... | |
(void) | - didReceiveInitialMetadata: |
Issued when initial metadata is received from the server. More... | |
(void) | - didReceiveData: |
Issued when gRPC message is received from the server. More... | |
(void) | - didCloseWithTrailingMetadata:error: |
Issued when a call finished. More... | |
(void) | - didWriteData |
Issued when flow control is enabled for the call and a message written with GRPCCall2::writeData is passed to gRPC core with SEND_MESSAGE operation. More... | |
![]() | |
(void) | - didReceiveRawMessage: |
Issued when a message is received from the server. More... | |
Class Methods | |
(instancetype) | + NS_UNAVAILABLE |
Additional Inherited Members | |
![]() | |
dispatch_queue_t | dispatchQueue |
The dispatch queue where the object's methods should be run on. More... | |
Base class for a gRPC interceptor.
The implementation of the base class provides default behavior of an interceptor, which is simply forward a request/callback to the next/previous interceptor in the chain. The base class implementation uses the same dispatch queue for both requests and callbacks.
An interceptor implementation should inherit from this base class and initialize the base class with [super initWithInterceptorManager:dispatchQueue:] for the default implementation to function properly.
- (void) cancel |
To cancel the call.
Reimplemented from <GRPCInterceptorInterface>.
- (void) didCloseWithTrailingMetadata: | (nullable NSDictionary *) | trailingMetadata | |
error: | (nullable NSError *) | error | |
Issued when a call finished.
If the call finished successfully, error
is nil and trailingMetadata
consists any trailing metadata received from the server. Otherwise, error
is non-nil and contains the corresponding error information, including gRPC error codes and error descriptions.
Reimplemented from <GRPCResponseHandler>.
- (void) didReceiveData: | (id) | data |
Issued when gRPC message is received from the server.
The data is always decompressed with gRPC or HTTP compression algorithm specified in the response header. data
could be any type as transport layer and interceptors may modify the type of the data (e.g. a Protobuf interceptor may consume NSData typed data and issue GPBMessage typed data to user). Users should interpret data
according to the configuration of their calls. Interceptor authors should not assume the type of data
unless an agreement is made on how it should be used in a particular call setting.
Reimplemented from <GRPCResponseHandler>.
- (void) didReceiveInitialMetadata: | (nullable NSDictionary *) | initialMetadata |
Issued when initial metadata is received from the server.
Reimplemented from <GRPCResponseHandler>.
- (void) didWriteData |
Issued when flow control is enabled for the call and a message written with GRPCCall2::writeData is passed to gRPC core with SEND_MESSAGE operation.
Reimplemented from <GRPCResponseHandler>.
- (void) finish |
To finish the stream of requests.
Reimplemented from <GRPCInterceptorInterface>.
- (nullable instancetype) initWithInterceptorManager: | (GRPCInterceptorManager *) | interceptorManager | |
dispatchQueue: | (dispatch_queue_t) | dispatchQueue | |
Initialize the interceptor with the next interceptor in the chain, and provide the dispatch queue that this interceptor's methods are dispatched onto.
+ (instancetype) NS_UNAVAILABLE |
- (instancetype) NS_UNAVAILABLE |
- (void) receiveNextMessages: | (NSUInteger) | numberOfMessages |
To indicate the call that the previous interceptor is ready to receive more messages.
Reimplemented from <GRPCInterceptorInterface>.
- (void) startWithRequestOptions: | (GRPCRequestOptions *) | requestOptions | |
callOptions: | (GRPCCallOptions *) | callOptions | |
To start the call.
This method will only be called once for each instance.
Reimplemented from <GRPCInterceptorInterface>.
- (void) writeData: | (id) | data |
To write data to the call.
Reimplemented from <GRPCInterceptorInterface>.