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

Recognize lock state of other semaphores with the same key. #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Recognize lock state of other semaphores with the same key. #46

wants to merge 1 commit into from

Conversation

eugenk
Copy link
Contributor

@eugenk eugenk commented Jul 9, 2016

This shall fix #45.

Instead of only checking for the tokens that the current instance knows about, the tokens are fetched from Redis in the locked? method.

@@ -170,6 +180,7 @@

describe "semaphore without staleness checking" do
let(:semaphore) { Redis::Semaphore.new(:my_semaphore, :redis => @redis) }
let(:semaphore2) { Redis::Semaphore.new(:my_semaphore, :redis => @redis) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new Ruby 1.9 hash syntax.

@eugenk
Copy link
Contributor Author

eugenk commented Jul 9, 2016

All the comments of Hound are targeted at code that has been there before. I'd rather not obey Hound in this pull request to keep the changes simple for the review.

@dv: If you want me to, I will change the name of the inner token variable and the hash syntax, but only if you tell me to do so.

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.

Recognize the lock state of multiple semaphores using the same key
2 participants