GRPC Objective-C
1.71.0
|
GRPCInterceptorManager is a helper class to forward messages between the interceptors. More...
#import <GRPCInterceptor.h>
Instance Methods | |
(instancetype) | - NS_UNAVAILABLE |
(nullable instancetype) | - initWithFactories:previousInterceptor:transportID: |
(void) | - shutDown |
Notify the manager that the interceptor has shut down and the manager should release references to other interceptors and stop forwarding requests/responses. More... | |
(void) | - startNextInterceptorWithRequest:callOptions: |
Notify the next interceptor in the chain to start the call and pass arguments. More... | |
(void) | - writeNextInterceptorWithData: |
Pass a message to be sent to the next interceptor in the chain. More... | |
(void) | - finishNextInterceptor |
Notify the next interceptor in the chain to finish the call. More... | |
(void) | - cancelNextInterceptor |
Notify the next interceptor in the chain to cancel the call. More... | |
(void) | - receiveNextInterceptorMessages: |
Notify the next interceptor in the chain to receive more messages. More... | |
(void) | - forwardPreviousInterceptorWithInitialMetadata: |
Forward initial metadata to the previous interceptor in the chain. More... | |
(void) | - forwardPreviousInterceptorWithData: |
Forward a received message to the previous interceptor in the chain. More... | |
(void) | - forwardPreviousInterceptorCloseWithTrailingMetadata:error: |
Forward call close and trailing metadata to the previous interceptor in the chain. More... | |
(void) | - forwardPreviousInterceptorDidWriteData |
Forward write completion to the previous interceptor in the chain. 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) | - didReceiveRawMessage: |
Issued when a message 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... | |
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... | |
GRPCInterceptorManager is a helper class to forward messages between the interceptors.
The interceptor manager object retains reference to the next and previous interceptor object in the interceptor chain, and forward corresponding events to them.
All methods except the initializer of the class can only be called on the manager's dispatch queue. Since the manager's dispatch queue targets corresponding interceptor's dispatch queue, it is also safe to call the manager's methods in the corresponding interceptor instance's methods that implement GRPCInterceptorInterface.
When an interceptor is shutting down, it must invoke -shutDown method of its corresponding manager so that references to other interceptors can be released and proper clean-up is made.
- (void) cancelNextInterceptor |
Notify the next interceptor in the chain to cancel the call.
- (void) finishNextInterceptor |
Notify the next interceptor in the chain to finish the call.
- (void) forwardPreviousInterceptorCloseWithTrailingMetadata: | (nullable NSDictionary *) | trailingMetadata | |
error: | (nullable NSError *) | error | |
Forward call close and trailing metadata to the previous interceptor in the chain.
- (void) forwardPreviousInterceptorDidWriteData |
Forward write completion to the previous interceptor in the chain.
- (void) forwardPreviousInterceptorWithData: | (nullable id) | data |
Forward a received message to the previous interceptor in the chain.
- (void) forwardPreviousInterceptorWithInitialMetadata: | (nullable NSDictionary *) | initialMetadata |
Forward initial metadata to the previous interceptor in the chain.
- (nullable instancetype) initWithFactories: | (nullable NSArray< id< GRPCInterceptorFactory >> *) | factories | |
previousInterceptor: | (nullable id< GRPCResponseHandler >) | previousInterceptor | |
transportID: | (GRPCTransportID) | transportID | |
+ (instancetype) NS_UNAVAILABLE |
- (instancetype) NS_UNAVAILABLE |
- (void) receiveNextInterceptorMessages: | (NSUInteger) | numberOfMessages |
Notify the next interceptor in the chain to receive more messages.
- (void) shutDown |
Notify the manager that the interceptor has shut down and the manager should release references to other interceptors and stop forwarding requests/responses.
- (void) startNextInterceptorWithRequest: | (GRPCRequestOptions *) | requestOptions | |
callOptions: | (GRPCCallOptions *) | callOptions | |
Notify the next interceptor in the chain to start the call and pass arguments.
- (void) writeNextInterceptorWithData: | (id) | data |
Pass a message to be sent to the next interceptor in the chain.