rename createChannel -> createChannelCallback

pull/16190/head
Muxi Yan 6 years ago
parent da42aa1c1b
commit 677ab86b4a
  1. 8
      src/objective-c/GRPCClient/private/GRPCChannel.m
  2. 2
      src/objective-c/GRPCClient/private/GRPCChannelPool.h
  3. 4
      src/objective-c/GRPCClient/private/GRPCChannelPool.m

@ -116,10 +116,10 @@ static GRPCChannelPool *gChannelPool;
GRPCChannelConfiguration *channelConfig =
[[GRPCChannelConfiguration alloc] initWithHost:host callOptions:callOptions];
return [gChannelPool channelWithConfiguration:channelConfig
createChannel:^{
return
[GRPCChannel createChannelWithConfiguration:channelConfig];
}];
createChannelCallback:^{
return
[GRPCChannel createChannelWithConfiguration:channelConfig];
}];
}
+ (void)closeOpenConnections {

@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN
* createChannel then add it in the pool. If the channel exists, increase its reference count.
*/
- (GRPCChannel *)channelWithConfiguration:(GRPCChannelConfiguration *)configuration
createChannel:(GRPCChannel * (^)(void))createChannel;
createChannelCallback:(GRPCChannel * (^)(void))createChannelCallback;
/** Decrease a channel's refcount. */
- (void)unrefChannelWithConfiguration:configuration;

@ -338,14 +338,14 @@ const NSTimeInterval kChannelDestroyDelay = 30;
}
- (GRPCChannel *)channelWithConfiguration:(GRPCChannelConfiguration *)configuration
createChannel:(GRPCChannel * (^)(void))createChannel {
createChannelCallback:(GRPCChannel * (^)(void))createChannelCallback {
__block GRPCChannel *channel;
dispatch_sync(_dispatchQueue, ^{
if ([self->_channelPool objectForKey:configuration]) {
[self->_callRefs[configuration] refChannel];
channel = self->_channelPool[configuration];
} else {
channel = createChannel();
channel = createChannelCallback();
self->_channelPool[configuration] = channel;
GRPCChannelCallRef *callRef = [[GRPCChannelCallRef alloc]

Loading…
Cancel
Save