Skip to content

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

Open
eugenk wants to merge 1 commit into
dv:masterfrom
eugenk:45-recognize_the_lock_state_of_multiple_semaphores_using_the_same_key
Open

Recognize lock state of other semaphores with the same key.#46
eugenk wants to merge 1 commit into
dv:masterfrom
eugenk:45-recognize_the_lock_state_of_multiple_semaphores_using_the_same_key

Conversation

@eugenk

@eugenk eugenk commented Jul 9, 2016

Copy link
Copy Markdown
Contributor

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.

Comment thread spec/semaphore_spec.rb

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
Copy Markdown
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

eugenk commented Jul 9, 2016

Copy link
Copy Markdown
Contributor Author

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