GRPC Objective-C  1.71.0
Instance Methods | Class Methods
GRPCInterceptorManager Class Reference

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...
 
- Instance Methods inherited from <GRPCInterceptorInterface>
(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...
 
- Instance Methods inherited from <GRPCResponseHandler>
(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

- Properties inherited from <GRPCDispatchable>
dispatch_queue_t dispatchQueue
 The dispatch queue where the object's methods should be run on. More...
 

Detailed Description

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.

Method Documentation

◆ cancelNextInterceptor

- (void) cancelNextInterceptor

Notify the next interceptor in the chain to cancel the call.

◆ finishNextInterceptor

- (void) finishNextInterceptor

Notify the next interceptor in the chain to finish the call.

◆ forwardPreviousInterceptorCloseWithTrailingMetadata:error:

- (void) forwardPreviousInterceptorCloseWithTrailingMetadata: (nullable NSDictionary *)  trailingMetadata
error: (nullable NSError *)  error 

Forward call close and trailing metadata to the previous interceptor in the chain.

◆ forwardPreviousInterceptorDidWriteData

- (void) forwardPreviousInterceptorDidWriteData

Forward write completion to the previous interceptor in the chain.

◆ forwardPreviousInterceptorWithData:

- (void) forwardPreviousInterceptorWithData: (nullable id)  data

Forward a received message to the previous interceptor in the chain.

◆ forwardPreviousInterceptorWithInitialMetadata:

- (void) forwardPreviousInterceptorWithInitialMetadata: (nullable NSDictionary *)  initialMetadata

Forward initial metadata to the previous interceptor in the chain.

◆ initWithFactories:previousInterceptor:transportID:

- (nullable instancetype) initWithFactories: (nullable NSArray< id< GRPCInterceptorFactory >> *)  factories
previousInterceptor: (nullable id< GRPCResponseHandler >)  previousInterceptor
transportID: (GRPCTransportID transportID 

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

◆ receiveNextInterceptorMessages:

- (void) receiveNextInterceptorMessages: (NSUInteger)  numberOfMessages

Notify the next interceptor in the chain to receive more messages.

◆ shutDown

- (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.

◆ startNextInterceptorWithRequest:callOptions:

- (void) startNextInterceptorWithRequest: (GRPCRequestOptions *)  requestOptions
callOptions: (GRPCCallOptions *)  callOptions 

Notify the next interceptor in the chain to start the call and pass arguments.

◆ writeNextInterceptorWithData:

- (void) writeNextInterceptorWithData: (id)  data

Pass a message to be sent to the next interceptor in the chain.


The documentation for this class was generated from the following file: