react-native-macos/ReactCommon/cxxreact
Ramanpreet Nara de56649430 Add CallInvoker::invokeSync
Summary:
We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue.

**Why is the native CallInvoker required for ObjC NativeModules?**
In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`.

**Why do we need sync call support for native `CallInvoker`?**
In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20829955

fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe
2020-04-03 09:47:42 -07:00
..
tests Replace fbsource// with // in xplat/js/ files [1] 2020-03-25 21:55:47 -07:00
.clang-tidy The life-changing magic of clang-tidying up 2020-02-04 11:09:30 -08:00
Android.mk Get CallInvokers from the bridge 2020-04-01 11:39:18 -07:00
BUCK Get CallInvokers from the bridge 2020-04-01 11:39:18 -07:00
CxxModule.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
CxxNativeModule.cpp Revert D20464278: Make Lambda function called in NativeModule mutable to improve performance 2020-03-16 16:21:28 -07:00
CxxNativeModule.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
Instance.cpp Add CallInvoker::invokeSync 2020-04-03 09:47:42 -07:00
Instance.h Add CallInvoker::invokeSync 2020-04-03 09:47:42 -07:00
JSBigString.cpp Replace folly::make_unique with std::make_unique (#26730) 2019-10-22 12:21:41 -07:00
JSBigString.h Tidy up license headers [1/n] 2019-10-16 10:06:33 -07:00
JSBundleType.cpp Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
JSBundleType.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
JSDeltaBundleClient.cpp Resolve React-cxxreact warnings (#28047) 2020-02-12 23:49:15 -08:00
JSDeltaBundleClient.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
JSExecutor.cpp Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
JSExecutor.h Split loadApplicationScript into initializeRuntime and loadBundle (#27844) 2020-04-01 17:52:39 -07:00
JSIndexedRAMBundle.cpp Replace folly::make_unique with std::make_unique (#26730) 2019-10-22 12:21:41 -07:00
JSIndexedRAMBundle.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
JSModulesUnbundle.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
JsArgumentHelpers-inl.h Run clang-format and apply patches 2020-02-27 08:29:30 -08:00
JsArgumentHelpers.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
MessageQueueThread.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
MethodCall.cpp Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
MethodCall.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
ModuleRegistry.cpp Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
ModuleRegistry.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
NativeModule.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
NativeToJsBridge.cpp Add CallInvoker::invokeSync 2020-04-03 09:47:42 -07:00
NativeToJsBridge.h Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker 2020-04-03 09:47:41 -07:00
RAMBundleRegistry.cpp Replace folly::make_unique with std::make_unique (#26730) 2019-10-22 12:21:41 -07:00
RAMBundleRegistry.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
React-cxxreact.podspec Get CallInvokers from the bridge 2020-04-01 11:39:18 -07:00
ReactMarker.cpp Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
ReactMarker.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
ReactNativeVersion.h Stamp React Native Version Into C++ Code (#28036) 2020-02-27 06:42:14 -08:00
RecoverableError.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
SampleCxxModule.cpp Replace folly::make_unique with std::make_unique (#26730) 2019-10-22 12:21:41 -07:00
SampleCxxModule.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
SharedProxyCxxModule.h Codemod: Clang-format for all files in `ReactCommon` directory 2020-02-25 19:52:27 -08:00
SystraceSection.h Remove __unused annotation from ConcreteSystraceSection ctor args 2019-11-19 10:51:59 -08:00
re_worker_requirements Sync worker requirement mismatches 2019-05-26 01:39:01 -07:00