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

Feature/28/multi resource lock #55

Merged
merged 6 commits into from
Jun 13, 2019
Merged

Feature/28/multi resource lock #55

merged 6 commits into from
Jun 13, 2019

Conversation

bernardmo
Copy link
Contributor

@bernardmo bernardmo commented Jun 12, 2019

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.

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
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f67796e on bernardmo:feature/28/multi-resource-lock into feab262 on mike-marcacci:master.

@coveralls
Copy link

coveralls commented Jun 12, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 40acb68 on bernardmo:feature/28/multi-resource-lock into feab262 on mike-marcacci:master.

@mike-marcacci
Copy link
Owner

mike-marcacci commented Jun 12, 2019

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.

@bernardmo
Copy link
Contributor Author

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 :)

@bernardmo
Copy link
Contributor Author

Hi Mike,

I've added some tests (basically copied all existing tests with multi-value resource)

@mike-marcacci mike-marcacci merged commit 6d1417e into mike-marcacci:master Jun 13, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants