Connection management

Reviewed By: javache

Differential Revision: D5171773

fbshipit-source-id: 6421739736f732e021e85474253ab0ddb3804b0a
This commit is contained in:
Theo Yaung
2017-06-08 07:34:45 -07:00
committed by Facebook Github Bot
parent a9e8b7bca5
commit ba2e486b33
10 changed files with 687 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
#import "RCTBridge+Private.h"
#import "RCTBridgeModule.h"
#import "RCTEventDispatcher.h"
#import "RCTInspectorDevServerHelper.h"
#import "RCTJSCSamplingProfiler.h"
#import "RCTLog.h"
#import "RCTProfile.h"
@@ -160,6 +161,20 @@ RCT_EXPORT_MODULE()
RCTAssert(_bridge == nil, @"RCTDevSettings module should not be reused");
_bridge = bridge;
[self _configurePackagerConnection];
#if RCT_DEV
// we need this dispatch back to the main thread because even though this
// is executed on the main thread, at this point the bridge is not yet
// finished with its initialisation. But it does finish by the time it
// relinquishes control of the main thread, so only queue on the JS thread
// after the current main thread operation is done.
dispatch_async(dispatch_get_main_queue(), ^{
[bridge dispatchBlock:^{
[RCTInspectorDevServerHelper connectForContext:bridge.jsContextRef
withBundleURL:bridge.bundleURL];
} queue:RCTJSThread];
});
#endif
}
- (dispatch_queue_t)methodQueue