aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCChannel.h
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-10-08 15:52:27 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-10-08 15:52:27 -0700
commit309ba191525a96c5314e5762ecaa2fffbc9eccbb (patch)
treeff431202f113bf6b11bac5a48282fa8394faccf3 /src/objective-c/GRPCClient/private/GRPCChannel.h
parent0fd4727defda5f8bef106a1f3b59263886b9b6c6 (diff)
Channel pool
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannel.h')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.h43
1 files changed, 17 insertions, 26 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.h b/src/objective-c/GRPCClient/private/GRPCChannel.h
index 6499d4398c..7d5039a8a2 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.h
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.h
@@ -21,6 +21,8 @@
#include <grpc/grpc.h>
@class GRPCCompletionQueue;
+@class GRPCCallOptions;
+@class GRPCChannelConfiguration;
struct grpc_channel_credentials;
/**
@@ -28,41 +30,30 @@ struct grpc_channel_credentials;
*/
@interface GRPCChannel : NSObject
-@property(nonatomic, readonly, nonnull) struct grpc_channel *unmanagedChannel;
-
- (nullable instancetype)init NS_UNAVAILABLE;
/**
- * Creates a secure channel to the specified @c host using default credentials and channel
- * arguments. If certificates could not be found to create a secure channel, then @c nil is
- * returned.
+ * Returns a channel connecting to \a host with options as \a callOptions. The channel may be new
+ * or a cached channel that is already connected.
*/
-+ (nullable GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host;
++ (nullable instancetype)channelWithHost:(nonnull NSString *)host
+ callOptions:(nullable GRPCCallOptions *)callOptions;
/**
- * Creates a secure channel to the specified @c host using Cronet as a transport mechanism.
- */
-#ifdef GRPC_COMPILE_WITH_CRONET
-+ (nullable GRPCChannel *)secureCronetChannelWithHost:(nonnull NSString *)host
- channelArgs:(nonnull NSDictionary *)channelArgs;
-#endif
-/**
- * Creates a secure channel to the specified @c host using the specified @c credentials and
- * @c channelArgs. Only in tests should @c GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg be set.
+ * Get a grpc core call object from this channel.
*/
-+ (nonnull GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host
- credentials:
- (nonnull struct grpc_channel_credentials *)credentials
- channelArgs:(nullable NSDictionary *)channelArgs;
+- (nullable grpc_call *)unmanagedCallWithPath:(nonnull NSString *)path
+ completionQueue:(nonnull GRPCCompletionQueue *)queue
+ callOptions:(nonnull GRPCCallOptions *)callOptions;
+
+- (void)unmanagedCallUnref;
/**
- * Creates an insecure channel to the specified @c host using the specified @c channelArgs.
+ * Create a channel object with the signature \a config. This function is used for testing only. Use
+ * channelWithHost:callOptions: in production.
*/
-+ (nonnull GRPCChannel *)insecureChannelWithHost:(nonnull NSString *)host
- channelArgs:(nullable NSDictionary *)channelArgs;
++ (nullable instancetype)createChannelWithConfiguration:(nonnull GRPCChannelConfiguration *)config;
-- (nullable grpc_call *)unmanagedCallWithPath:(nonnull NSString *)path
- serverName:(nonnull NSString *)serverName
- timeout:(NSTimeInterval)timeout
- completionQueue:(nonnull GRPCCompletionQueue *)queue;
+// TODO (mxyan): deprecate with GRPCCall:closeOpenConnections
++ (void)closeOpenConnections;
@end