GRPCCall.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
37 #import <Foundation/Foundation.h>
38 
39 #import "GRPCCallOptions.h"
40 #import "GRPCDispatchable.h"
41 #import "GRPCTypes.h"
42 
43 // The legacy header is included for backwards compatibility. Some V1 API users are still using
44 // GRPCCall by importing GRPCCall.h header so we need this import.
45 #import "GRPCCallLegacy.h"
46 
47 NS_ASSUME_NONNULL_BEGIN
48 
51 
52 @optional
53 
57 - (void)didReceiveInitialMetadata:(nullable NSDictionary *)initialMetadata;
58 
68 - (void)didReceiveRawMessage:(nullable NSData *)message;
69 
79 - (void)didReceiveData:(id)data;
80 
87 - (void)didCloseWithTrailingMetadata:(nullable NSDictionary *)trailingMetadata
88  error:(nullable NSError *)error;
89 
94 - (void)didWriteData;
95 
96 @end
97 
102 @interface GRPCRequestOptions : NSObject <NSCopying>
103 
104 - (instancetype)init NS_UNAVAILABLE;
105 
106 + (instancetype)new NS_UNAVAILABLE;
107 
109 - (instancetype)initWithHost:(NSString *)host
110  path:(NSString *)path
111  safety:(GRPCCallSafety)safety NS_DESIGNATED_INITIALIZER;
112 
114 @property(copy, readonly) NSString *host;
116 @property(copy, readonly) NSString *path;
121 @property(readonly) GRPCCallSafety safety;
122 
123 @end
124 
125 #pragma mark GRPCCall
126 
130 @interface GRPCCall2 : NSObject
131 
132 - (instancetype)init NS_UNAVAILABLE;
133 
134 + (instancetype)new NS_UNAVAILABLE;
135 
142 - (instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions
143  responseHandler:(id<GRPCResponseHandler>)responseHandler
144  callOptions:(nullable GRPCCallOptions *)callOptions
145  NS_DESIGNATED_INITIALIZER;
150 - (instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions
151  responseHandler:(id<GRPCResponseHandler>)responseHandler;
152 
156 - (void)start;
157 
163 - (void)cancel;
164 
169 - (void)writeData:(id)data;
170 
175 - (void)finish;
176 
183 - (void)receiveNextMessages:(NSUInteger)numberOfMessages;
184 
188 @property(readonly, copy) GRPCCallOptions *callOptions;
189 
191 @property(readonly, copy) GRPCRequestOptions *requestOptions;
192 
193 @end
194 
195 NS_ASSUME_NONNULL_END
init
const char * init
Definition: upb/upb/bindings/lua/main.c:49
finish
static int finish(struct hexdump_ctx *ctx)
Definition: hexdump.c:148
GRPCCallOptions
Definition: GRPCCallOptions.h:32
GRPCTypes.h
copy
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
Definition: message_compress.cc:145
GRPCCall2::callOptions
GRPCCallOptions * callOptions
Definition: GRPCCall.h:188
check_documentation.path
path
Definition: check_documentation.py:57
GRPCRequestOptions::host
NSString * host
Definition: GRPCCall.h:114
env.new
def new
Definition: env.py:51
-[GRPCResponseHandler-p didWriteData]
void didWriteData()
start
static uint64_t start
Definition: benchmark-pound.c:74
GRPCResponseHandler-p
Definition: GRPCCall.h:50
GRPCCallOptions.h
GRPCDispatchable-p
Definition: GRPCDispatchable.h:23
GRPCCall2::requestOptions
GRPCRequestOptions * requestOptions
Definition: GRPCCall.h:191
-[GRPCCall2 NS_UNAVAILABLE]
instancetype NS_UNAVAILABLE()
GRPCCallLegacy.h
GRPCDispatchable.h
GRPCRequestOptions
Definition: GRPCCall.h:102
GRPCCall2
Definition: GRPCCall.h:130
cancel
bool cancel
Definition: client_callback_end2end_test.cc:634
-[GRPCRequestOptions NS_UNAVAILABLE]
instancetype NS_UNAVAILABLE()
GRPCRequestOptions::safety
GRPCCallSafety safety
Definition: GRPCCall.h:121


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:48