Skip to content
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

RFC: locks and queues #110

Open
dankrause opened this issue Apr 23, 2015 · 0 comments
Open

RFC: locks and queues #110

dankrause opened this issue Apr 23, 2015 · 0 comments

Comments

@dankrause
Copy link
Contributor

It seems to me that it's possible to implement atomic exclusive locking by slightly abusing the ACL features of Parse. Also, given the ability to lock like this, a queue should also be possible.

Here's a first pass at an implementation: https://gist.github.com/dankrause/a58161d3f4a7db904b57

You'll see that a lock is held by a user, so we assume that each client has a different user. To claim the lock, you simply alter the ACLs in such a way that no other user can write. To release it, you revert the ACLs.

My class handles a collection of locks, where you can fetch locks using normal queries, and then claim and release them.

A subclass of this handles a queue, which is basically just an ordered collection of locks.

Any interest in including something like this in ParsePy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant