aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-03-22 14:30:16 -0700
committerGravatar Muxi Yan <mxyan@google.com>2017-03-22 14:30:16 -0700
commitc2e53b5af4830c14d5cda72bba20df2855789300 (patch)
treec70183b10ec1a009269719df6ced9ccb6c1b0c62 /src/objective-c/GRPCClient
parent9f74e838e2cfdba10176e9fda3baa3dfe45a5ac0 (diff)
Addressed the comments
Diffstat (limited to 'src/objective-c/GRPCClient')
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m5
-rw-r--r--src/objective-c/GRPCClient/private/GRPCOpBatchLog.h5
-rw-r--r--src/objective-c/GRPCClient/private/GRPCOpBatchLog.m10
3 files changed, 16 insertions, 4 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index 7d928f81c1..051138ea4d 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -107,8 +107,11 @@ static NSMutableDictionary *callFlags;
GRPCRequestHeaders *_requestHeaders;
+ // In the case that the call is a unary call (i.e. the writer to GRPCCall is of type
+ // GRXImmediateSingleWriter), GRPCCall will delay sending ops (not send them to C core
+ // immediately) and buffer them into a batch _unaryOpBatch. The batch is sent to C core when
+ // the SendClose op is added.
BOOL _unaryCall;
-
NSMutableArray *_unaryOpBatch;
}
diff --git a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h
index dbc3417acf..753c4cfee6 100644
--- a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h
+++ b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h
@@ -31,6 +31,9 @@
*
*/
+
+#ifdef GRPC_TEST_OBJC
+
/**
* Logs the op batches of a client. Used for testing.
*/
@@ -52,3 +55,5 @@
+ (NSArray *)obtainAndCleanOpBatchLog;
@end
+
+#endif
diff --git a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m
index c172c3c988..4b40baf122 100644
--- a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m
+++ b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m
@@ -31,11 +31,13 @@
*
*/
+#ifdef GRPC_TEST_OBJC
+
#import "GRPCOpBatchLog.h"
-@implementation GRPCOpBatchLog
+static NSMutableArray *opBatchLog = nil;
-NSMutableArray *opBatchLog = nil;
+@implementation GRPCOpBatchLog
+ (void)enableOpBatchLog:(BOOL)enabled {
@synchronized (opBatchLog) {
@@ -65,4 +67,6 @@ NSMutableArray *opBatchLog = nil;
}
}
-@end \ No newline at end of file
+@end
+
+#endif