WICG / shared-storage

Explainer for proposed web platform Shared Storage API
Other
90 stars 23 forks source link

Should worklets get to run past the duration of the page? #12

Closed pythagoraskitty closed 2 years ago

pythagoraskitty commented 3 years ago

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?

xyaoinum commented 3 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.

jkarlin commented 2 years ago

@xyaoinum Can you update the explainer to reflect this behavior change and then close this comment?

xyaoinum commented 2 years ago

Updated the explainer