w3c / compute-pressure

A web API proposal that provides information about available compute capacity
https://www.w3.org/TR/compute-pressure/
Other
69 stars 10 forks source link

Optionally get called back at a constant interval #109

Closed kenchris closed 2 years ago

kenchris commented 2 years ago

Zoom use-case

Currently the callback only gets invoked when there is a change (state or factors), but for drawing plots etc, it is useful to get called back at each reporting frequency step. We could make this configurable like { continues: true }

kenchris commented 2 years ago

I am thinking about the best name for this. A few options below:

duplicates: false ignoreDuplicates: true filterDuplicates: true continues: false continuesReporting: false allowDuplicates: false

Or something like setting a strategy like "always", "change" but that seems a bit too elaborate

kenchris commented 2 years ago

Given https://github.com/WICG/compute-pressure/issues/112 we could use the default ignoreDuplicateSamples: true

kenchris commented 2 years ago

We thought a lot about this, and after discussions we have decided to shelve this feature until we have clear and strong use-cases.

An observer is supposed to only call the callback when there is an observable change.