aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCChannelPool.h
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-11-26 17:17:09 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-11-26 17:38:52 -0800
commit5ae61f5a5a267f5975248d4262133a740e09a66b (patch)
tree17b9c4a8131c7b657865e5b65236798115bc541c /src/objective-c/GRPCClient/private/GRPCChannelPool.h
parent03c73e92f1dedb1de4bba0269e7c614b47cf8035 (diff)
Multiple fixes
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannelPool.h')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannelPool.h49
1 files changed, 25 insertions, 24 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.h b/src/objective-c/GRPCClient/private/GRPCChannelPool.h
index 1e3c1d7d97..26600ef3a9 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannelPool.h
+++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.h
@@ -39,12 +39,16 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface GRPCPooledChannel : NSObject
+- (nullable instancetype)init NS_UNAVAILABLE;
+
++ (nullable instancetype)new NS_UNAVAILABLE;
+
/**
* Initialize with an actual channel object \a channel and a reference to the channel pool.
*/
- (nullable instancetype)initWithChannelConfiguration:
(GRPCChannelConfiguration *)channelConfiguration
- channelPool:(GRPCChannelPool *)channelPool;
+ channelPool:(GRPCChannelPool *)channelPool NS_DESIGNATED_INITIALIZER;
/**
* Create a grpc core call object (grpc_call) from this channel. If channel is disconnected, get a
@@ -59,17 +63,21 @@ NS_ASSUME_NONNULL_BEGIN
* \a unmanagedCallWithPath:completionQueue:callOptions: and decrease channel refcount. If refcount
* of the channel becomes 0, return the channel object to channel pool.
*/
-- (void)unrefUnmanagedCall:(grpc_call *)unmanagedCall;
+- (void)destroyUnmanagedCall:(grpc_call *)unmanagedCall;
/**
- * Force the channel to disconnect immediately.
+ * Force the channel to disconnect immediately. Subsequent calls to unmanagedCallWithPath: will
+ * attempt to reconnect to the remote channel.
*/
- (void)disconnect;
-// The following methods and properties are for test only
+@end
+
+/** Test-only interface for \a GRPCPooledChannel. */
+@interface GRPCPooledChannel (Test)
/**
- * Return the pointer to the real channel wrapped by the proxy.
+ * Return the pointer to the raw channel wrapped.
*/
@property(atomic, readonly) GRPCChannel *wrappedChannel;
@@ -81,6 +89,10 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface GRPCChannelPool : NSObject
+- (nullable instancetype)init NS_UNAVAILABLE;
+
++ (nullable instancetype)new NS_UNAVAILABLE;
+
/**
* Get the global channel pool.
*/
@@ -92,31 +104,20 @@ NS_ASSUME_NONNULL_BEGIN
- (GRPCPooledChannel *)channelWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions;
/**
- * This method is deprecated.
- *
- * Destroy all open channels and close their connections.
+ * Disconnect all channels in this pool.
*/
-- (void)closeOpenConnections;
-
-// Test-only methods below
+- (void)disconnectAllChannels;
-/**
- * Get an instance of pool isolated from the global shared pool. This method is for test only.
- * Global pool should be used in production.
- */
-- (nullable instancetype)init;
+@end
-/**
- * Simulate a network transition event and destroy all channels. This method is for internal and
- * test only.
- */
-- (void)disconnectAllChannels;
+/** Test-only interface for \a GRPCChannelPool. */
+@interface GRPCChannelPool (Test)
/**
- * Set the destroy delay of channels. A channel should be destroyed if it stayed idle (no active
- * call on it) for this period of time. This property is for test only.
+ * Get an instance of pool isolated from the global shared pool with channels' destroy delay being
+ * \a destroyDelay.
*/
-@property(atomic) NSTimeInterval destroyDelay;
+- (nullable instancetype)initTestPoolWithDestroyDelay:(NSTimeInterval)destroyDelay;
@end