riju / web-worker-quality-of-service

W3C Explainer : Add latencySensitive hint to WebWorkers.
4 stars 0 forks source link

How to query the current `qualityOfService` from WorkerGlobalScope? #2

Open hoch opened 1 year ago

hoch commented 1 year ago

An interesting idea! Kudos to everyone involved in the proposal.

Based on the proposed IDL, you can set the quality of service at the construction time:

let worker = new Worker('worker.js', { qualityOfService: 'high' });

But how can we query the current qualityOfService from the created worker instance? The QoS option is supposed to be a "hint" so this option might not be honored the browser implementation.

partial interface Worker : EventTarget {
  attribute readonly qualityOfService;
}

Perhaps something like this will be sensible, but IMO the implication of it needs to be discussion.