redis-semaphore icon indicating copy to clipboard operation
redis-semaphore copied to clipboard

Generated signal is not unique

Open enkessler opened this issue 7 years ago • 1 comments

The wait/signal usage pattern described in the Readme says that "signal puts the specified token back on the semaphore, or generates a unique new token and puts that back if none is passed". Looking at the signal method, however, it looks like it will never generate a new token. It will either use the provided token or use 1 as the token.

def signal(token = 1)
  token ||= generate_unique_token

  # other stuff
end

enkessler avatar May 08 '17 18:05 enkessler