diff options
author | Muxi Yan <mxyan@google.com> | 2017-03-07 18:26:42 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-03-07 18:26:42 -0800 |
commit | 016d1085fc950023f232c4a8f93723fd591c6baa (patch) | |
tree | 1d12ab44a42df307aae35ae6e82d982a8a1d9f09 /src | |
parent | 43730581800577cf0e02b66677fe73841bdbecfe (diff) |
Eliminate magic number 6
Diffstat (limited to 'src')
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.m | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 1a8fc2e2ef..1cda827e78 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -46,6 +46,11 @@ #import "private/NSDictionary+GRPC.h" #import "private/NSError+GRPC.h" +// At most 6 ops can be in an op batch for a client: SEND_INITIAL_METADATA, +// SEND_MESSAGE, SEND_CLOSE_FROM_CLIENT, RECV_INITIAL_METADATA, RECV_MESSAGE, +// and RECV_STATUS_ON_CLIENT. +NSInteger kMaxClientBatch = 6; + NSString * const kGRPCHeadersKey = @"io.grpc.HeadersKey"; NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; static NSMutableDictionary *callFlags; @@ -165,7 +170,7 @@ static NSMutableDictionary *callFlags; if ([requestWriter isKindOfClass:[GRXImmediateSingleWriter class]]) { _unaryCall = YES; - _unaryOpBatch = [NSMutableArray arrayWithCapacity:6]; + _unaryOpBatch = [NSMutableArray arrayWithCapacity:kMaxClientBatch]; } } return self; |