rename kChannelPool->gChannelPool

pull/16190/head
Muxi Yan 7 years ago
parent 6032e960d4
commit 62fb609df7
  1. 10
      src/objective-c/GRPCClient/private/GRPCChannel.m

@ -64,7 +64,7 @@
} }
- (void)unmanagedCallUnref { - (void)unmanagedCallUnref {
[kChannelPool unrefChannelWithConfiguration:_configuration]; [gChannelPool unrefChannelWithConfiguration:_configuration];
} }
- (nullable instancetype)initWithUnmanagedChannel:(nullable grpc_channel *)unmanagedChannel - (nullable instancetype)initWithUnmanagedChannel:(nullable grpc_channel *)unmanagedChannel
@ -94,12 +94,12 @@
} }
static dispatch_once_t initChannelPool; static dispatch_once_t initChannelPool;
static GRPCChannelPool *kChannelPool; static GRPCChannelPool *gChannelPool;
+ (nullable instancetype)channelWithHost:(NSString *)host + (nullable instancetype)channelWithHost:(NSString *)host
callOptions:(GRPCCallOptions *)callOptions { callOptions:(GRPCCallOptions *)callOptions {
dispatch_once(&initChannelPool, ^{ dispatch_once(&initChannelPool, ^{
kChannelPool = [[GRPCChannelPool alloc] init]; gChannelPool = [[GRPCChannelPool alloc] init];
}); });
NSURL *hostURL = [NSURL URLWithString:[@"https://" stringByAppendingString:host]]; NSURL *hostURL = [NSURL URLWithString:[@"https://" stringByAppendingString:host]];
@ -109,7 +109,7 @@ static GRPCChannelPool *kChannelPool;
GRPCChannelConfiguration *channelConfig = GRPCChannelConfiguration *channelConfig =
[[GRPCChannelConfiguration alloc] initWithHost:host callOptions:callOptions]; [[GRPCChannelConfiguration alloc] initWithHost:host callOptions:callOptions];
return [kChannelPool channelWithConfiguration:channelConfig return [gChannelPool channelWithConfiguration:channelConfig
createChannel:^{ createChannel:^{
return return
[GRPCChannel createChannelWithConfiguration:channelConfig]; [GRPCChannel createChannelWithConfiguration:channelConfig];
@ -117,7 +117,7 @@ static GRPCChannelPool *kChannelPool;
} }
+ (void)closeOpenConnections { + (void)closeOpenConnections {
[kChannelPool clear]; [gChannelPool clear];
} }
@end @end

Loading…
Cancel
Save