react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

feat(Worklets): add invokeSync in JSScheduler

Open tjzel opened this issue 6 months ago • 2 comments

Summary

Motivated by #7638, it would be handy to invoke something synchronously and safely on the RN Runtime. Since jsCallInvoker deadlocks on invokeSync, I added invokeSync to JSScheduler that also checks whether such call is safe.

Test plan

Nothing so far, there's no use of invokeSyncOnJS.

tjzel avatar Jun 16 '25 17:06 tjzel

I don't think canInvokeSyncOnJS needs to be public. How about making it private? I'm afraid it can be misused sometime in the future if we keep it public.

tomekzaw avatar Jun 16 '25 17:06 tomekzaw

@tomekzaw Could you elaborate on that? I added it specifically to be able to know if I should make a sync or an async call.

tjzel avatar Jun 16 '25 18:06 tjzel