Introduce CatalystInstance.getNativeCallInvokerHolder()

Summary: CatalystInstanceImpl is responsible for creating the NativeModules thread. We therefore expose a method `getNativeCallInvokerHolder()` on this hybrid class to create and give us access to the `CallInvokerHolder` for the NativeModules thread.

Reviewed By: PeteTheHeat

Differential Revision: D17422164

fbshipit-source-id: 316423847518124115643549fa73a8533d493cd0
This commit is contained in:
Ramanpreet Nara
2019-09-20 10:52:57 -07:00
committed by Facebook Github Bot
parent 1b91bfbf63
commit 77fe4f087d
4 changed files with 31 additions and 9 deletions
@@ -107,11 +107,17 @@ public interface CatalystInstance
void addJSIModules(List<JSIModuleSpec> jsiModules);
/**
* Returns a hybrid object that contains a pointer to JSCallInvoker. Required for
* TurboModuleManager initialization.
* Returns a hybrid object that contains a pointer to a JS CallInvoker, which is used to schedule
* work on the JS Thread. Required for TurboModuleManager initialization.
*/
CallInvokerHolder getJSCallInvokerHolder();
/**
* Returns a hybrid object that contains a pointer to a Native CallInvoker, which is used to
* schedule work on the NativeModules thread. Required for TurboModuleManager initialization.
*/
CallInvokerHolder getNativeCallInvokerHolder();
/**
* For the time being, we want code relying on the old infra to also work with TurboModules.
* Hence, we must provide the TurboModuleRegistry to CatalystInstance so that getNativeModule,
@@ -109,6 +109,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
public native CallInvokerHolderImpl getJSCallInvokerHolder();
public native CallInvokerHolderImpl getNativeCallInvokerHolder();
private CatalystInstanceImpl(
final ReactQueueConfigurationSpec reactQueueConfigurationSpec,
final JavaScriptExecutor jsExecutor,