Flush queue every 5ms during JS execution

Summary: public

Implement the iOS side of the optmisation previously implemented in android
(D2485402)

Depends on D2540746

Reviewed By: javache

Differential Revision: D2541118

fb-gh-sync-id: f3590600a6defa2da75c5b7b2cced6ad8bfea6cb
This commit is contained in:
Tadeu Zagallo
2015-10-19 08:02:50 -07:00
committed by facebook-github-bot-2
parent 607527c0d4
commit 31f9a690f3
3 changed files with 42 additions and 8 deletions

View File

@@ -24,7 +24,7 @@
@property (nonatomic, strong, readonly) RCTBridge *batchedBridge;
- (void)_handleBuffer:(id)buffer;
- (void)handleBuffer:(id)buffer;
- (void)setUp;
@end
@@ -169,7 +169,7 @@ _Pragma("clang diagnostic pop")
NSArray *args = @[@1234, @5678, @"stringy", @{@"a": @1}, @42];
NSArray *buffer = @[@[testModuleID], @[testMethodID], @[args], @[], @1234567];
[_bridge.batchedBridge _handleBuffer:buffer];
[_bridge.batchedBridge handleBuffer:buffer];
dispatch_sync(_methodQueue, ^{
// clear the queue
@@ -180,7 +180,7 @@ _Pragma("clang diagnostic pop")
- (void)DISABLED_testBadArgumentsCount
{
//NSArray *bufferWithMissingArgument = @[@[@1], @[@0], @[@[@1234, @5678, @"stringy", @{@"a": @1}/*, @42*/]], @[], @1234567];
//[_bridge _handleBuffer:bufferWithMissingArgument];
//[_bridge handleBuffer:bufferWithMissingArgument];
NSLog(@"WARNING: testBadArgumentsCount is temporarily disabled until we have a better way to test cases that we expect to trigger redbox errors");
}