GRPC Objective-C  1.71.0
Instance Methods
<GRPCResponseHandler> Protocol Reference

An object can implement this protocol to receive responses from server from a call. More...

#import <GRPCCall.h>

Instance Methods

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

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

An object can implement this protocol to receive responses from server from a call.

Method Documentation

◆ didCloseWithTrailingMetadata:error:

- (void) didCloseWithTrailingMetadata: (nullable NSDictionary *)  trailingMetadata
error: (nullable NSError *)  error 
optional

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 in GRPCInterceptor.

◆ didReceiveData:

- (void) didReceiveData: (id)  data
optional

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 in GRPCInterceptor.

◆ didReceiveInitialMetadata:

- (void) didReceiveInitialMetadata: (nullable NSDictionary *)  initialMetadata
optional

Issued when initial metadata is received from the server.

Reimplemented in GRPCInterceptor.

◆ didReceiveRawMessage:

- (void) didReceiveRawMessage: (nullable NSData *)  message
optional

Issued when a message is received from the server.

The message is the raw data received from the server, with decompression and without proto deserialization.

This method is deprecated and does not work with interceptors. To use GRPCCall2 interface with interceptor, please implement GRPCResponseHandler::didReceiveData method and leave this method unimplemented. If this method and didReceiveRawMessage are implemented at the same time, implementation of this method will be ignored.

◆ didWriteData

- (void) didWriteData
optional

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 in GRPCInterceptor.


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