|
|
|
@ -17,6 +17,8 @@ |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \mainpage notitle |
|
|
|
|
* |
|
|
|
|
* The gRPC protocol is an RPC protocol on top of HTTP2. |
|
|
|
|
* |
|
|
|
|
* While the most common type of RPC receives only one request message and returns only one response |
|
|
|
@ -55,26 +57,30 @@ NS_ASSUME_NONNULL_BEGIN |
|
|
|
|
- (void)didReceiveInitialMetadata:(nullable NSDictionary *)initialMetadata; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is deprecated and does not work with interceptors. To use GRPCCall2 interface with |
|
|
|
|
* interceptor, implement didReceiveData: instead. To implement an interceptor, please leave this |
|
|
|
|
* method unimplemented and implement didReceiveData: method instead. If this method and |
|
|
|
|
* didReceiveRawMessage are implemented at the same time, implementation of this method will be |
|
|
|
|
* ignored. |
|
|
|
|
* |
|
|
|
|
* 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. |
|
|
|
|
* |
|
|
|
|
* <b> This method is deprecated and does not work with interceptors.</b> 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. |
|
|
|
|
*/ |
|
|
|
|
- (void)didReceiveRawMessage:(nullable NSData *)message; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Issued when a decompressed message is received from the server. The message is decompressed, and |
|
|
|
|
* deserialized if a marshaller is provided to the call (marshaller is work in progress). |
|
|
|
|
* 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. \p 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 \p |
|
|
|
|
* data according to the configuration of their calls. Interceptor authors should not assume the |
|
|
|
|
* type of \p data unless an agreement is made on how it should be used in a particular call |
|
|
|
|
* setting. |
|
|
|
|
*/ |
|
|
|
|
- (void)didReceiveData:(id)data; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Issued when a call finished. If the call finished successfully, \a error is nil and \a |
|
|
|
|
* trainingMetadata consists any trailing metadata received from the server. Otherwise, \a error |
|
|
|
|
* Issued when a call finished. If the call finished successfully, \p error is nil and \p |
|
|
|
|
* trailingMetadata consists any trailing metadata received from the server. Otherwise, \p error |
|
|
|
|
* is non-nil and contains the corresponding error information, including gRPC error codes and |
|
|
|
|
* error descriptions. |
|
|
|
|
*/ |
|
|
|
@ -82,16 +88,16 @@ NS_ASSUME_NONNULL_BEGIN |
|
|
|
|
error:(nullable NSError *)error; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Issued when flow control is enabled for the call and a message written with writeData: method of |
|
|
|
|
* GRPCCall2 is passed to gRPC core with SEND_MESSAGE operation. |
|
|
|
|
* 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. |
|
|
|
|
*/ |
|
|
|
|
- (void)didWriteData; |
|
|
|
|
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Call related parameters. These parameters are automatically specified by Protobuf. If directly |
|
|
|
|
* using the \a GRPCCall2 class, users should specify these parameters manually. |
|
|
|
|
* HTTP request parameters. If Protobuf is used, these parameters are automatically generated by |
|
|
|
|
* Protobuf. If directly using the GRPCCall2 class, users should specify these parameters manually. |
|
|
|
|
*/ |
|
|
|
|
@interface GRPCRequestOptions : NSObject<NSCopying> |
|
|
|
|
|
|
|
|
@ -119,7 +125,7 @@ NS_ASSUME_NONNULL_BEGIN |
|
|
|
|
#pragma mark GRPCCall |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A \a GRPCCall2 object represents an RPC call. |
|
|
|
|
* A GRPCCall2 object represents an RPC call. |
|
|
|
|
*/ |
|
|
|
|
@interface GRPCCall2 : NSObject |
|
|
|
|
|
|
|
|
@ -169,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN |
|
|
|
|
- (void)finish; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tell gRPC to receive the next N gRPC message from gRPC core. |
|
|
|
|
* Tell gRPC to receive the next N gRPC messages. |
|
|
|
|
* |
|
|
|
|
* This method should only be used when flow control is enabled. When flow control is not enabled, |
|
|
|
|
* this method is a no-op. |
|
|
|
|