GRPC Objective-C  1.73.0
Instance Methods | Class Methods | Properties
GRPCCall Class Reference

This is the legacy interface of this gRPC library. More...

#import <GRPCCallLegacy.h>

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
- Instance Methods inherited from GRXWriter
(void) - startWithWriteable:
 Transition to the Started state, and start sending messages to the writeable (a reference to it is retained). More...
 
(void) - finishWithError:
 Send writesFinishedWithError:errorOrNil to the writeable. More...
 
(GRXWriter *) - map:
 Returns a writer that wraps the receiver, and has all the values the receiver would write transformed by the provided mapping function. More...
 

Class Methods

(void) + setUserAgentPrefix:forHost:
 
(void) + setUserAgentSuffix:forHost:
 
(void) + setResponseSizeLimit:forHost:
 
("The API for this feature is experimental, " "and might be removed or modified at any " "time.") + DEPRECATED_MSG_ATTRIBUTE
 
(void) + setDefaultCompressMethod:forhost:
 
(void) + setKeepaliveWithInterval:timeout:forHost:
 
(void) + enableRetry:forHost:
 
(void) + setMinConnectTimeout:initialBackoff:maxBackoff:forHost:
 
(BOOL) + setTLSPEMRootCerts:forHost:error:
 
(BOOL) + setTLSPEMRootCerts:withPrivateKey:withCertChain:forHost:error:
 
(void) + useTestCertsPath:testName:forHost:
 
(void) + useInsecureConnectionsForHost:
 
(void) + resetHostSettings
 
- Class Methods inherited from GRXWriter
(instancetype) + writerWithEnumerator:
 Returns a writer that pulls values from the passed NSEnumerator instance and pushes them to its writeable. More...
 
(instancetype) + writerWithValueSupplier:
 Returns a writer that pushes to its writeable the successive values returned by the passed block. More...
 
(instancetype) + writerWithContainer:
 Returns a writer that iterates over the values of the passed container and pushes them to its writeable. More...
 
(instancetype) + writerWithValue:
 Returns a writer that sends the passed value to its writeable and then finishes (releasing the value). More...
 
(instancetype) + writerWithError:
 Returns a writer that, as part of its start method, sends the passed error to the writeable (then releasing the error). More...
 
(instancetype) + emptyWriter
 Returns a writer that, as part of its start method, finishes immediately without sending any values to its writeable. More...
 

Properties

NSString * oauth2AccessToken
 
NSString * oauth2ChallengeHeader
 
id< GRPCAuthorizationProtocoltokenProvider
 
- Properties inherited from GRXWriter
GRXWriterState state
 This property can be used to query the current state of the writer, which determines how it might currently use its writeable. More...
 
NSMutableDictionary * requestHeaders
 The container of the request headers of an RPC conforms to this protocol, which is a subset of NSMutableDictionary's interface. More...
 
NSDictionary * responseHeaders
 This dictionary is populated with the HTTP headers received from the server. More...
 
NSDictionary * responseTrailers
 Same as responseHeaders, but populated with the HTTP trailers received from the server before the call finishes. More...
 
NSString * serverName
 
NSTimeInterval timeout
 
(instancetype) - initWithHost:path:requestsWriter:
 The request writer has to write NSData objects into the provided Writeable. More...
 
(void) - cancel
 Finishes the request side of this call, notifies the server that the RPC should be cancelled, and finishes the response side of the call with an error of code CANCELED. More...
 
(void) - setResponseDispatchQueue:
 
(void) + setCallSafety:host:path:
 The following methods are deprecated. More...
 

Detailed Description

This is the legacy interface of this gRPC library.

This API is deprecated and users should use GRPCCall2 in GRPCCall.h. This API exists solely for the purpose of backwards compatibility. Represents a single gRPC remote call.

Method Documentation

◆ cancel

- (void) cancel

Finishes the request side of this call, notifies the server that the RPC should be cancelled, and finishes the response side of the call with an error of code CANCELED.

◆ DEPRECATED_MSG_ATTRIBUTE

+ ("The API for this feature is experimental, " "and might be removed or modified at any " "time.") DEPRECATED_MSG_ATTRIBUTE

Provided by category GRPCCall(ChannelArg).

◆ enableRetry:forHost:

+ (void) enableRetry: (BOOL)  enabled
forHost: (nonnull NSString *)  host 

Provided by category GRPCCall(ChannelArg).

◆ initWithHost:path:requestsWriter:

- (instancetype) initWithHost: (NSString *)  host
path: (NSString *)  path
requestsWriter: (GRXWriter *)  requestWriter 

The request writer has to write NSData objects into the provided Writeable.

The server will receive each of those separately and in order as distinct messages. A gRPC call might not complete until the request writer finishes. On the other hand, the request finishing doesn't necessarily make the call to finish, as the server might continue sending messages to the response side of the call indefinitely (depending on the semantics of the specific remote method called). To finish a call right away, invoke cancel. host parameter should not contain the scheme (http:// or https://), only the name or IP addr and the port number, for example "localhost:5050".

◆ NS_UNAVAILABLE

- (instancetype) NS_UNAVAILABLE

◆ resetHostSettings

+ (void) resetHostSettings

Provided by category GRPCCall(Tests).

◆ setCallSafety:host:path:

+ (void) setCallSafety: (GRPCCallSafety)  callSafety
host: (NSString *)  host
path: (NSString *)  path 

The following methods are deprecated.

◆ setDefaultCompressMethod:forhost:

+ (void) setDefaultCompressMethod: (GRPCCompressAlgorithm algorithm
forhost: (nonnull NSString *)  host 

Provided by category GRPCCall(ChannelArg).

◆ setKeepaliveWithInterval:timeout:forHost:

+ (void) setKeepaliveWithInterval: (int)  interval
timeout: (int)  timeout
forHost: (nonnull NSString *)  host 

Provided by category GRPCCall(ChannelArg).

◆ setMinConnectTimeout:initialBackoff:maxBackoff:forHost:

+ (void) setMinConnectTimeout: (unsigned int)  timeout
initialBackoff: (unsigned int)  initialBackoff
maxBackoff: (unsigned int)  maxBackoff
forHost: (nonnull NSString *)  host 

Provided by category GRPCCall(ChannelArg).

◆ setResponseDispatchQueue:

- (void) setResponseDispatchQueue: (dispatch_queue_t)  queue

◆ setResponseSizeLimit:forHost:

+ (void) setResponseSizeLimit: (NSUInteger)  limit
forHost: (nonnull NSString *)  host 

Provided by category GRPCCall(ChannelArg).

◆ setTLSPEMRootCerts:forHost:error:

+ (BOOL) setTLSPEMRootCerts: (nullable NSString *)  pemRootCert
forHost: (nonnull NSString *)  host
error: (NSError *_Nullable *_Nullable)  errorPtr 

Provided by category GRPCCall(ChannelCredentials).

◆ setTLSPEMRootCerts:withPrivateKey:withCertChain:forHost:error:

+ (BOOL) setTLSPEMRootCerts: (nullable NSString *)  pemRootCerts
withPrivateKey: (nullable NSString *)  pemPrivateKey
withCertChain: (nullable NSString *)  pemCertChain
forHost: (nonnull NSString *)  host
error: (NSError *_Nullable *_Nullable)  errorPtr 

Provided by category GRPCCall(ChannelCredentials).

◆ setUserAgentPrefix:forHost:

+ (void) setUserAgentPrefix: (nonnull NSString *)  userAgentPrefix
forHost: (nonnull NSString *)  host 

Provided by category GRPCCall(ChannelArg).

◆ setUserAgentSuffix:forHost:

+ (void) setUserAgentSuffix: (nonnull NSString *)  userAgentSuffix
forHost: (nonnull NSString *)  host 

Provided by category GRPCCall(ChannelArg).

◆ useInsecureConnectionsForHost:

+ (void) useInsecureConnectionsForHost: (NSString *)  host

Provided by category GRPCCall(Tests).

◆ useTestCertsPath:testName:forHost:

+ (void) useTestCertsPath: (NSString *)  certsPath
testName: (NSString *)  testName
forHost: (NSString *)  host 

Provided by category GRPCCall(Tests).

Property Documentation

◆ oauth2AccessToken

- (NSString*) oauth2AccessToken
readwriteatomiccopy

Provided by category GRPCCall(OAuth2).

◆ oauth2ChallengeHeader

- (NSString*) oauth2ChallengeHeader
readatomiccopy

Provided by category GRPCCall(OAuth2).

◆ requestHeaders

- (NSMutableDictionary*) requestHeaders
readatomicassign

The container of the request headers of an RPC conforms to this protocol, which is a subset of NSMutableDictionary's interface.

It will become a NSMutableDictionary later on. The keys of this container are the header names, which per the HTTP standard are case- insensitive. They are stored in lowercase (which is how HTTP/2 mandates them on the wire), and can only consist of ASCII characters. A header value is a NSString object (with only ASCII characters), unless the header name has the suffix "-bin", in which case the value has to be a NSData object. These HTTP headers will be passed to the server as part of this call. Each HTTP header is a name-value pair with string names and either string or binary values.

The passed dictionary has to use NSString keys, corresponding to the header names. The value associated to each can be a NSString object or a NSData object. E.g.:

call.requestHeaders ="authorization": @"Bearer ..."};

call.requestHeaders["my-header-bin"] = someData;

After the call is started, trying to modify this property is an error.

The property is initialized to an empty NSMutableDictionary.

◆ responseHeaders

- (NSDictionary*) responseHeaders
readatomiccopy

This dictionary is populated with the HTTP headers received from the server.

This happens before any response message is received from the server. It has the same structure as the request headers dictionary: Keys are NSString header names; names ending with the suffix "-bin" have a NSData value; the others have a NSString value.

The value of this property is nil until all response headers are received, and will change before any of -writeValue: or -writesFinishedWithError: are sent to the writeable.

◆ responseTrailers

- (NSDictionary*) responseTrailers
readatomiccopy

Same as responseHeaders, but populated with the HTTP trailers received from the server before the call finishes.

The value of this property is nil until all response trailers are received, and will change before -writesFinishedWithError: is sent to the writeable.

◆ serverName

- (NSString*) serverName
readwriteatomiccopy

◆ timeout

- (NSTimeInterval) timeout
readwriteatomic

◆ tokenProvider

- (id<GRPCAuthorizationProtocol>) tokenProvider
readwriteatomicstrong

Provided by category GRPCCall(OAuth2).


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