mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Connection management
Reviewed By: javache Differential Revision: D5171773 fbshipit-source-id: 6421739736f732e021e85474253ab0ddb3804b0a
This commit is contained in:
committed by
Facebook Github Bot
parent
a9e8b7bca5
commit
ba2e486b33
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user