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
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 indrainMicrotasks
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 indrainMicrotasks