GRPC Objective-C  1.71.0
Instance Methods | Class Methods | Properties
GRPCCall2 Class Reference

A GRPCCall2 object represents an RPC call. More...

#import <GRPCCall.h>

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(instancetype) - initWithRequestOptions:responseHandler:callOptions:
 Designated initializer for a call. More...
 
(instancetype) - initWithRequestOptions:responseHandler:
 Convenience initializer for a call that uses default call options (see GRPCCallOptions.m for the default options). More...
 
(void) - start
 Starts the call. More...
 
(void) - cancel
 Cancel the request of this call at best effort. More...
 
(void) - writeData:
 Send a message to the server. More...
 
(void) - finish
 Finish the RPC request and half-close the call. More...
 
(void) - receiveNextMessages:
 Tell gRPC to receive the next N gRPC messages. More...
 

Class Methods

(instancetype) + NS_UNAVAILABLE
 
(void) + registerGlobalInterceptor:
 Register a global interceptor's factory in the current process. More...
 
(nullable id< GRPCInterceptorFactory >) + globalInterceptorFactory
 Get the global interceptor's factory object. More...
 

Properties

GRPCCallOptionscallOptions
 Get a copy of the original call options. More...
 
GRPCRequestOptionsrequestOptions
 Get a copy of the original request options. More...
 

Detailed Description

A GRPCCall2 object represents an RPC call.

Method Documentation

◆ cancel

- (void) cancel

Cancel the request of this call at best effort.

It attempts to notify the server that the RPC should be cancelled, and issue didCloseWithTrailingMetadata:error: callback with error code CANCELED if no other error code has already been issued.

◆ finish

- (void) finish

Finish the RPC request and half-close the call.

The server may still send messages and/or trailers to the client. The method must only be called once and after start is called.

◆ globalInterceptorFactory

+ (nullable id<GRPCInterceptorFactory>) globalInterceptorFactory

Get the global interceptor's factory object.

Provided by category GRPCCall2(Interceptor).

◆ initWithRequestOptions:responseHandler:

- (instancetype) initWithRequestOptions: (GRPCRequestOptions *)  requestOptions
responseHandler: (id< GRPCResponseHandler >)  responseHandler 

Convenience initializer for a call that uses default call options (see GRPCCallOptions.m for the default options).

◆ initWithRequestOptions:responseHandler:callOptions:

- (instancetype) initWithRequestOptions: (GRPCRequestOptions *)  requestOptions
responseHandler: (id< GRPCResponseHandler >)  responseHandler
callOptions: (nullable GRPCCallOptions *)  NS_DESIGNATED_INITIALIZER 

Designated initializer for a call.

Parameters
requestOptionsProtobuf generated parameters for the call.
responseHandlerThe object to which responses should be issued.
callOptionsOptions for the call.

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

◆ receiveNextMessages:

- (void) receiveNextMessages: (NSUInteger)  numberOfMessages

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.

◆ registerGlobalInterceptor:

+ (void) registerGlobalInterceptor: (nonnull id< GRPCInterceptorFactory >)  interceptorFactory

Register a global interceptor's factory in the current process.

Only one interceptor can be registered in a process. If another one attempts to be registered, an exception will be raised.

Parameters
[in]interceptorFactoryThe factory object that generates the global interceptor for each call.

Provided by category GRPCCall2(Interceptor).

◆ start

- (void) start

Starts the call.

This function must only be called once for each instance.

◆ writeData:

- (void) writeData: (id)  data

Send a message to the server.

The data is subject to marshaller serialization and compression (marshaller is work in progress).

Property Documentation

◆ callOptions

- (GRPCCallOptions*) callOptions
readatomiccopy

Get a copy of the original call options.

◆ requestOptions

- (GRPCRequestOptions*) requestOptions
readatomiccopy

Get a copy of the original request options.


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