Rename enableFlowControl to flowControlEnabled for naming consistency

pull/17936/head
Muxi Yan 6 years ago
parent a59e362214
commit bd30e73995
  1. 8
      src/objective-c/GRPCClient/GRPCCall.m
  2. 4
      src/objective-c/GRPCClient/GRPCCallOptions.h
  3. 28
      src/objective-c/GRPCClient/GRPCCallOptions.m
  4. 12
      src/objective-c/tests/APIv2Tests/APIv2Tests.m
  5. 2
      src/objective-c/tests/InteropTests.m

@ -388,7 +388,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
- (void)issueDidWriteData {
@synchronized(self) {
if (_callOptions.enableFlowControl && [_handler respondsToSelector:@selector(didWriteData)]) {
if (_callOptions.flowControlEnabled && [_handler respondsToSelector:@selector(didWriteData)]) {
dispatch_async(_dispatchQueue, ^{
id<GRPCResponseHandler> copiedHandler = nil;
@synchronized(self) {
@ -401,7 +401,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages {
// branching based on _callOptions.enableFlowControl is handled inside _call
// branching based on _callOptions.flowControlEnabled is handled inside _call
GRPCCall *copiedCall = nil;
@synchronized(self) {
copiedCall = _call;
@ -674,7 +674,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
if (_state != GRXWriterStateStarted) {
return;
}
if (_callOptions.enableFlowControl && (_pendingCoreRead || _pendingReceiveNextMessages == 0)) {
if (_callOptions.flowControlEnabled && (_pendingCoreRead || _pendingReceiveNextMessages == 0)) {
return;
}
_pendingCoreRead = YES;
@ -781,7 +781,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
@synchronized(self) {
_pendingReceiveNextMessages += numberOfMessages;
if (_state != GRXWriterStateStarted || !_callOptions.enableFlowControl) {
if (_state != GRXWriterStateStarted || !_callOptions.flowControlEnabled) {
return;
}
[self maybeStartNextRead];

@ -96,7 +96,7 @@ typedef NS_ENUM(NSUInteger, GRPCTransportType) {
* receiveNextMessage: must be called each time before gRPC call issues a didReceiveMessage
* callback.
*/
@property(readonly) BOOL enableFlowControl;
@property(readonly) BOOL flowControlEnabled;
// OAuth2 parameters. Users of gRPC may specify one of the following two parameters.
@ -251,7 +251,7 @@ typedef NS_ENUM(NSUInteger, GRPCTransportType) {
* assumes their own responsibility of flow control by keeping tracking of the pending writes in
* the call.
*/
@property(readwrite) BOOL enableFlowControl;
@property(readwrite) BOOL flowControlEnabled;
// OAuth2 parameters. Users of gRPC may specify one of the following two parameters.

@ -22,7 +22,7 @@
// The default values for the call options.
static NSString *const kDefaultServerAuthority = nil;
static const NSTimeInterval kDefaultTimeout = 0;
static const BOOL kDefaultEnableFlowControl = NO;
static const BOOL kDefaultFlowControlEnabled = NO;
static NSDictionary *const kDefaultInitialMetadata = nil;
static NSString *const kDefaultUserAgentPrefix = nil;
static const NSUInteger kDefaultResponseSizeLimit = 0;
@ -60,7 +60,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
@protected
NSString *_serverAuthority;
NSTimeInterval _timeout;
BOOL _enableFlowControl;
BOOL _flowControlEnabled;
NSString *_oauth2AccessToken;
id<GRPCAuthorizationProtocol> _authTokenProvider;
NSDictionary *_initialMetadata;
@ -86,7 +86,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
@synthesize serverAuthority = _serverAuthority;
@synthesize timeout = _timeout;
@synthesize enableFlowControl = _enableFlowControl;
@synthesize flowControlEnabled = _flowControlEnabled;
@synthesize oauth2AccessToken = _oauth2AccessToken;
@synthesize authTokenProvider = _authTokenProvider;
@synthesize initialMetadata = _initialMetadata;
@ -112,7 +112,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
- (instancetype)init {
return [self initWithServerAuthority:kDefaultServerAuthority
timeout:kDefaultTimeout
enableFlowControl:kDefaultEnableFlowControl
flowControlEnabled:kDefaultFlowControlEnabled
oauth2AccessToken:kDefaultOauth2AccessToken
authTokenProvider:kDefaultAuthTokenProvider
initialMetadata:kDefaultInitialMetadata
@ -138,7 +138,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
- (instancetype)initWithServerAuthority:(NSString *)serverAuthority
timeout:(NSTimeInterval)timeout
enableFlowControl:(BOOL)enableFlowControl
flowControlEnabled:(BOOL)flowControlEnabled
oauth2AccessToken:(NSString *)oauth2AccessToken
authTokenProvider:(id<GRPCAuthorizationProtocol>)authTokenProvider
initialMetadata:(NSDictionary *)initialMetadata
@ -163,7 +163,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
if ((self = [super init])) {
_serverAuthority = [serverAuthority copy];
_timeout = timeout < 0 ? 0 : timeout;
_enableFlowControl = enableFlowControl;
_flowControlEnabled = flowControlEnabled;
_oauth2AccessToken = [oauth2AccessToken copy];
_authTokenProvider = authTokenProvider;
_initialMetadata =
@ -199,7 +199,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
GRPCCallOptions *newOptions =
[[GRPCCallOptions allocWithZone:zone] initWithServerAuthority:_serverAuthority
timeout:_timeout
enableFlowControl:_enableFlowControl
flowControlEnabled:_flowControlEnabled
oauth2AccessToken:_oauth2AccessToken
authTokenProvider:_authTokenProvider
initialMetadata:_initialMetadata
@ -228,7 +228,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
GRPCMutableCallOptions *newOptions = [[GRPCMutableCallOptions allocWithZone:zone]
initWithServerAuthority:[_serverAuthority copy]
timeout:_timeout
enableFlowControl:_enableFlowControl
flowControlEnabled:_flowControlEnabled
oauth2AccessToken:[_oauth2AccessToken copy]
authTokenProvider:_authTokenProvider
initialMetadata:[[NSDictionary alloc] initWithDictionary:_initialMetadata
@ -309,7 +309,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
@dynamic serverAuthority;
@dynamic timeout;
@dynamic enableFlowControl;
@dynamic flowControlEnabled;
@dynamic oauth2AccessToken;
@dynamic authTokenProvider;
@dynamic initialMetadata;
@ -335,7 +335,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
- (instancetype)init {
return [self initWithServerAuthority:kDefaultServerAuthority
timeout:kDefaultTimeout
enableFlowControl:kDefaultEnableFlowControl
flowControlEnabled:kDefaultFlowControlEnabled
oauth2AccessToken:kDefaultOauth2AccessToken
authTokenProvider:kDefaultAuthTokenProvider
initialMetadata:kDefaultInitialMetadata
@ -363,7 +363,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
GRPCCallOptions *newOptions =
[[GRPCCallOptions allocWithZone:zone] initWithServerAuthority:_serverAuthority
timeout:_timeout
enableFlowControl:_enableFlowControl
flowControlEnabled:_flowControlEnabled
oauth2AccessToken:_oauth2AccessToken
authTokenProvider:_authTokenProvider
initialMetadata:_initialMetadata
@ -392,7 +392,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
GRPCMutableCallOptions *newOptions = [[GRPCMutableCallOptions allocWithZone:zone]
initWithServerAuthority:_serverAuthority
timeout:_timeout
enableFlowControl:_enableFlowControl
flowControlEnabled:_flowControlEnabled
oauth2AccessToken:_oauth2AccessToken
authTokenProvider:_authTokenProvider
initialMetadata:_initialMetadata
@ -429,8 +429,8 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
}
}
- (void)setEnableFlowControl:(BOOL)enableFlowControl {
_enableFlowControl = enableFlowControl;
- (void)setFlowControlEnabled:(BOOL)flowControlEnabled {
_flowControlEnabled = flowControlEnabled;
}
- (void)setOauth2AccessToken:(NSString *)oauth2AccessToken {

@ -522,7 +522,7 @@ static const NSTimeInterval kInvertedTimeout = 2;
safety:GRPCCallSafetyDefault];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.enableFlowControl = YES;
options.flowControlEnabled = YES;
GRPCCall2 *call =
[[GRPCCall2 alloc] initWithRequestOptions:callRequest
responseHandler:[[ClientTestsBlockCallbacks alloc]
@ -564,7 +564,7 @@ static const NSTimeInterval kInvertedTimeout = 2;
safety:GRPCCallSafetyDefault];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.enableFlowControl = YES;
options.flowControlEnabled = YES;
__block int unblocked = NO;
GRPCCall2 *call = [[GRPCCall2 alloc]
initWithRequestOptions:callRequest
@ -625,7 +625,7 @@ static const NSTimeInterval kInvertedTimeout = 2;
safety:GRPCCallSafetyDefault];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.enableFlowControl = YES;
options.flowControlEnabled = YES;
__block NSUInteger messageId = 0;
__block GRPCCall2 *call = [[GRPCCall2 alloc]
initWithRequestOptions:callRequest
@ -668,7 +668,7 @@ static const NSTimeInterval kInvertedTimeout = 2;
safety:GRPCCallSafetyDefault];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.enableFlowControl = YES;
options.flowControlEnabled = YES;
__block BOOL closed = NO;
GRPCCall2 *call = [[GRPCCall2 alloc]
initWithRequestOptions:callRequest
@ -709,7 +709,7 @@ static const NSTimeInterval kInvertedTimeout = 2;
safety:GRPCCallSafetyDefault];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.enableFlowControl = YES;
options.flowControlEnabled = YES;
__block BOOL closed = NO;
GRPCCall2 *call = [[GRPCCall2 alloc]
initWithRequestOptions:callRequest
@ -740,7 +740,7 @@ static const NSTimeInterval kInvertedTimeout = 2;
path:kUnaryCallMethod.HTTPPath
safety:GRPCCallSafetyDefault];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.enableFlowControl = YES;
options.flowControlEnabled = YES;
options.transportType = GRPCTransportTypeInsecure;
RMTSimpleRequest *request = [RMTSimpleRequest message];

@ -656,7 +656,7 @@ BOOL isRemoteInteropTest(NSString *host) {
options.transportType = [[self class] transportType];
options.PEMRootCertificates = [[self class] PEMRootCertificates];
options.hostNameOverride = [[self class] hostNameOverride];
options.enableFlowControl = YES;
options.flowControlEnabled = YES;
__block BOOL canWriteData = NO;
__block GRPCStreamingProtoCall *call = [_service

Loading…
Cancel
Save