Kudo / react-native-v8

Opt-in V8 runtime for React Native Android
MIT License
924 stars 69 forks source link

Fix v8 foreground tasks not executed #90

Closed Kudo closed 2 years ago

Kudo commented 3 years ago

Why

Fix #89 that we did not run v8 foreground tasks

How

as a jsi::Runtime, we didn't have a chance to control the main thread. it looks like the best fit is in drainMicrotasks where not ideal but works. i've also done some profile, the time for the while loop takes at maximum 100ms. before there are any better alternatives, i decide to pump the message loop in drainMicrotasks