-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Web Locks API #15905
Comments
The biggest problem is we don't have the concept of "same origin" in a lot of cases. It would effectively only work across workers of the same runtime instance. Can you provide a specific use case you think this would solve? You say "access to a single resource" but that is very vague and a specific use case might help make the need clearer. |
That would suit me just fine. My use case is managing many class instances' access to a single database. The value of new inserts into this database is based on data that came before it, so writes must be strictly sequential. Concurrent access would result in an invalid state. Additionally, this same codebase is used in the browser where many tabs are accessing the same IndexedDB. That I can use Deno to develop and test these features and confidently ship them to the browser is a huge deal. I've been told I can also use |
This would be great for distributed locks in Redis. |
I think the weblocks API in deno should behave similar to the Deno BroadcastChannel. |
https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API
I've been looking for some ways to manage access to a single resource, and this seems like it could fill quite a lot of the gap left by shared workers.
The text was updated successfully, but these errors were encountered: