ProtoRPC.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 
19 #import <Foundation/Foundation.h>
20 
21 // import legacy header for compatibility with users using the ProtoRPC interface
22 #import "ProtoRPCLegacy.h"
23 
24 #import "ProtoMethod.h"
25 
26 NS_ASSUME_NONNULL_BEGIN
27 
28 @class GRPCRequestOptions;
29 @class GRPCCallOptions;
30 @class GPBMessage;
31 
33 @protocol GRPCProtoResponseHandler <NSObject>
34 
35 @required
36 
41 @property(atomic, readonly) dispatch_queue_t dispatchQueue;
42 
43 @optional
44 
48 - (void)didReceiveInitialMetadata:(nullable NSDictionary *)initialMetadata;
49 
53 - (void)didReceiveProtoMessage:(nullable GPBMessage *)message;
54 
61 - (void)didCloseWithTrailingMetadata:(nullable NSDictionary *)trailingMetadata
62  error:(nullable NSError *)error;
63 
69 - (void)didWriteMessage;
70 
71 @end
72 
81 
89 - (nullable instancetype)initWithResponseHandler:(void (^)(ResponseType, NSError *))handler
90  responseDispatchQueue:(nullable dispatch_queue_t)dispatchQueue;
91 
93 @property(readonly, nullable) NSDictionary *responseHeaders;
94 
96 @property(readonly, nullable) NSDictionary *responseTrailers;
97 
98 @end
99 
101 @interface GRPCUnaryProtoCall : NSObject
102 
103 - (instancetype)init NS_UNAVAILABLE;
104 
105 + (instancetype)new NS_UNAVAILABLE;
106 
111 - (nullable instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions
112  message:(GPBMessage *)message
113  responseHandler:(id<GRPCProtoResponseHandler>)handler
114  callOptions:(nullable GRPCCallOptions *)callOptions
115  responseClass:(Class)responseClass NS_DESIGNATED_INITIALIZER;
116 
120 - (void)start;
121 
127 - (void)cancel;
128 
129 @end
130 
132 @interface GRPCStreamingProtoCall : NSObject
133 
134 - (instancetype)init NS_UNAVAILABLE;
135 
136 + (instancetype)new NS_UNAVAILABLE;
137 
142 - (nullable instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions
143  responseHandler:(id<GRPCProtoResponseHandler>)handler
144  callOptions:(nullable GRPCCallOptions *)callOptions
145  responseClass:(Class)responseClass NS_DESIGNATED_INITIALIZER;
146 
150 - (void)start;
151 
157 - (void)cancel;
158 
163 - (void)writeMessage:(GPBMessage *)message;
164 
169 - (void)finish;
170 
179 - (void)receiveNextMessage;
180 
189 - (void)receiveNextMessages:(NSUInteger)numberOfMessages;
190 
191 @end
192 
193 NS_ASSUME_NONNULL_END
GRPCStreamingProtoCall
Definition: ProtoRPC.h:132
init
const char * init
Definition: upb/upb/bindings/lua/main.c:49
grpc._simple_stubs.ResponseType
ResponseType
Definition: _simple_stubs.py:28
finish
static int finish(struct hexdump_ctx *ctx)
Definition: hexdump.c:148
-[GRPCStreamingProtoCall NS_UNAVAILABLE]
instancetype NS_UNAVAILABLE()
-[GRPCProtoResponseHandler-p didWriteMessage]
void didWriteMessage()
GRPCCallOptions
Definition: GRPCCallOptions.h:32
env.new
def new
Definition: env.py:51
GRPCUnaryProtoCall
Definition: ProtoRPC.h:101
GRPCProtoResponseHandler-p
Definition: ProtoRPC.h:33
start
static uint64_t start
Definition: benchmark-pound.c:74
ProtoRPCLegacy.h
ProtoMethod.h
-[GRPCStreamingProtoCall receiveNextMessage]
void receiveNextMessage()
GRPCProtoResponseHandler-p::dispatchQueue
dispatch_queue_t dispatchQueue
Definition: ProtoRPC.h:41
GRPCUnaryResponseHandler
Definition: ProtoRPC.h:80
GRPCRequestOptions
Definition: GRPCCall.h:102
GRPCUnaryResponseHandler::responseHeaders
NSDictionary * responseHeaders
Definition: ProtoRPC.h:93
GPBMessage
Definition: bloaty/third_party/protobuf/objectivec/GPBMessage.h:83
GRPCUnaryResponseHandler::responseTrailers
NSDictionary * responseTrailers
Definition: ProtoRPC.h:96
cancel
bool cancel
Definition: client_callback_end2end_test.cc:634
-[GRPCUnaryProtoCall NS_UNAVAILABLE]
instancetype NS_UNAVAILABLE()


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:57