w3c / web-locks

Cross-tab resource coordination API
https://w3c.github.io/web-locks/
Other
124 stars 16 forks source link

Early return when a request is not grantable in queue processing #82

Closed saschanaz closed 3 years ago

saschanaz commented 3 years ago

https://wicg.github.io/web-locks/#process-the-lock-request-queue

Currently it scans the whole queue, but there is no need to do that since if something is not grantable then all the following items are automatically not grantable (as they won't be the first item in the queue).

inexorabletash commented 3 years ago

Ah, yes, that is probably because in earlier iterations of the spec there was one queue per manager, rather than a queue per resource name. But since that's not the case, it does seem like this can be simplified...

(Early on we have the ability to request a lock over multiple resources simultaneously)