-
Notifications
You must be signed in to change notification settings - Fork 159
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/28/multi resource lock #55
Feature/28/multi resource lock #55
Conversation
Locking of multiple resources in single call is "hard" due to nature of redis. Even when using MULTI (transaction support) all commands which are queued successfully will be executed (so we can't rely on redis to fail on already set key). This commit provides a sort-of-workaround by checking existence of values but it still doesn't provide strong guarantees for settings/removing/extending all resources. Ref #28
This is an excellent contribution – thanks! I'll want to have some basic tests of this feature before publishing it. If you've got the time to add those, that would be amazing! If not, I can add some when I get a chance. EDIT: The coveralls badge is kind of useless, but clicking on it can show in greater detail what is and isn't covered. |
Hi, I'll try to add tests when I catch time. Btw I don't have much exp with node tests, but I will follow your examples :) |
Hi Mike, I've added some tests (basically copied all existing tests with multi-value resource) |
Add support for locking multiple resources
Locking of multiple resources in single call is "hard" due to nature of redis. Even when using MULTI (transaction support) all commands which are queued successfully will be executed (so we can't rely on redis to fail on already set key).
This branch provides a sort-of-workaround by checking existence of values but it still doesn't provide strong guarantees for settings/removing/extending all resources.