GRPC Objective-C  1.26.0
GRPCChannel.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 #include <grpc/grpc.h>
22 
23 @protocol GRPCChannelFactory;
24 
25 @class GRPCCompletionQueue;
26 @class GRPCCallOptions;
28 struct grpc_channel_credentials;
29 
30 NS_ASSUME_NONNULL_BEGIN
31 
36 @interface GRPCChannelConfiguration : NSObject<NSCopying>
37 
38 - (instancetype)init NS_UNAVAILABLE;
39 
40 + (instancetype) new NS_UNAVAILABLE;
41 
43 @property(copy, readonly) NSString *host;
44 
49 @property(readonly) GRPCCallOptions *callOptions;
50 
52 @property(readonly) id<GRPCChannelFactory> channelFactory;
53 
55 @property(copy, readonly) NSDictionary *channelArgs;
56 
57 - (nullable instancetype)initWithHost:(NSString *)host
58  callOptions:(GRPCCallOptions *)callOptions NS_DESIGNATED_INITIALIZER;
59 
60 @end
61 
65 @interface GRPCChannel : NSObject
66 
67 - (nullable instancetype)init NS_UNAVAILABLE;
68 
69 + (nullable instancetype) new NS_UNAVAILABLE;
70 
74 - (nullable instancetype)initWithChannelConfiguration:
75  (GRPCChannelConfiguration *)channelConfiguration NS_DESIGNATED_INITIALIZER;
76 
81 - (nullable grpc_call *)unmanagedCallWithPath:(NSString *)path
82  completionQueue:(GRPCCompletionQueue *)queue
83  callOptions:(GRPCCallOptions *)callOptions;
84 
85 @end
86 
87 NS_ASSUME_NONNULL_END
NSString * host
The host that this channel is connected to.
Definition: GRPCChannel.h:43
This class lets one more easily use |grpc_completion_queue|.
Definition: GRPCCompletionQueue.h:35
NSDictionary * channelArgs
Acquire the dictionary of channel args with current configurations.
Definition: GRPCChannel.h:55
instancetype NS_UNAVAILABLE()
nullable instancetype NS_UNAVAILABLE()
GRPCCallOptions * callOptions
Options of the corresponding call.
Definition: GRPCChannel.h:49
id< GRPCChannelFactory > channelFactory
Acquire the factory to generate a new channel with current configurations.
Definition: GRPCChannel.h:52
A factory interface which generates new channel.
Definition: GRPCChannelFactory.h:26
Immutable user configurable options for a gRPC call.
Definition: GRPCCallOptions.h:30
Each separate instance of this class represents at least one TCP connection to the provided host...
Definition: GRPCChannel.h:65
Signature for the channel.
Definition: GRPCChannel.h:36