aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCChannelPool.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-11-09 11:06:46 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-11-09 11:06:46 -0800
commit2895ee9b6a63c19ebbd6c188ab475f0a6e7f0ba5 (patch)
tree3c93584393e9dfe723b0fc6aab726c983ee3cba5 /src/objective-c/GRPCClient/private/GRPCChannelPool.m
parent33022c9172bd3cf52c9aa3416ce9c69d9f3c6494 (diff)
clang-format
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannelPool.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannelPool.m16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
index 8a3b5edfa1..85ca527277 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
@@ -26,8 +26,8 @@
#import "GRPCCronetChannelFactory.h"
#import "GRPCInsecureChannelFactory.h"
#import "GRPCSecureChannelFactory.h"
-#import "version.h"
#import "utilities.h"
+#import "version.h"
#import <GRPCClient/GRPCCall+Cronet.h>
#include <grpc/support/log.h>
@@ -62,11 +62,8 @@ static dispatch_once_t gInitChannelPool;
return self;
}
-- (GRPCChannel *)channelWithHost:(NSString *)host
- callOptions:(GRPCCallOptions *)callOptions {
- return [self channelWithHost:host
- callOptions:callOptions
- destroyDelay:0];
+- (GRPCChannel *)channelWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions {
+ return [self channelWithHost:host callOptions:callOptions destroyDelay:0];
}
- (GRPCChannel *)channelWithHost:(NSString *)host
@@ -76,14 +73,15 @@ static dispatch_once_t gInitChannelPool;
GRPCAssert(callOptions != nil, NSInvalidArgumentException, @"callOptions must not be empty.");
GRPCChannel *channel;
GRPCChannelConfiguration *configuration =
- [[GRPCChannelConfiguration alloc] initWithHost:host callOptions:callOptions];
+ [[GRPCChannelConfiguration alloc] initWithHost:host callOptions:callOptions];
@synchronized(self) {
channel = _channelPool[configuration];
if (channel == nil || channel.disconnected) {
if (destroyDelay == 0) {
channel = [[GRPCChannel alloc] initWithChannelConfiguration:configuration];
} else {
- channel = [[GRPCChannel alloc] initWithChannelConfiguration:configuration destroyDelay:destroyDelay];
+ channel = [[GRPCChannel alloc] initWithChannelConfiguration:configuration
+ destroyDelay:destroyDelay];
}
_channelPool[configuration] = channel;
}
@@ -91,8 +89,6 @@ static dispatch_once_t gInitChannelPool;
return channel;
}
-
-
+ (void)closeOpenConnections {
[[GRPCChannelPool sharedInstance] destroyAllChannels];
}