Closed pythagoraskitty closed 2 years ago
Another reason a caller may want a keep-alive worklet is to do end-of-page computing/reporting. In this case, they may want to call addModule without waiting, even if it's capable to wait.
Could start with some small threshold that is unlikely to cause performance/metrics regressions (e.g. 2 seconds), and add metrics to see whether most pending operations could finish within this period.
@xyaoinum Can you update the explainer to reflect this behavior change and then close this comment?
Updated the explainer
This seems necessary since the caller has no idea when the worklet finishes, so how can it know when it can navigate away from the page, unless it’s confident that the worklet will continue to run after the navigation?
We’d need a timeout. How long should it be?