redis-mutex 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 253615b378afcd470a670355dc6924fc18ce9bad
4
- data.tar.gz: 22fdcf12b682dd3550a6a73b2ef1b0aa96aaa5b3
3
+ metadata.gz: ae1c89915620c81811eee75220df0e12ed90fd3e
4
+ data.tar.gz: 0bde420a795d1dece14c400ebe9a47943492aed2
5
5
  SHA512:
6
- metadata.gz: e4e348e87e282e279e3bb4a780f420484365ceaa101438de710f7b0fe5ed9843278d3615579c343497d23041980614fbd2772c2a85f86ec4029800e92104b888
7
- data.tar.gz: 06897c56818022fae3b8b97a8a391f1d72e06887916fb08ed81d58f3b37341063a4c15feff782f82ed6a7072a342a66d501a7e44e4e213f6774c489a8b83602e
6
+ metadata.gz: 60c210cae1d61688157c5d028b9f39af6bfdd8341f9aa76197c34bc755ed9f9625113e978b2c7ca2bf57bb88f1963b044abc4e603b2a8e3ef15aefb65e7dd7de
7
+ data.tar.gz: 9b04bdb81b5d38e08a09b66666325a8c7f916ae110866e09c102534a14bef2553a8a6527f4215388e98a04c67ab34ba94cf45f1605dba03eef7a62b3bf8cbfdb
@@ -1,9 +1,11 @@
1
1
  language: ruby
2
2
  services:
3
3
  - redis-server
4
+ before_install:
5
+ - gem install bundler
6
+ - gem update bundler
4
7
  rvm:
5
- - 2.0.0
6
- - 2.1.0
7
- - rbx-2
8
+ - 2.1
9
+ - 2.2
10
+ - 2.3.0
8
11
  - ruby-head
9
- - jruby-head
data/README.md CHANGED
@@ -3,7 +3,7 @@ Redis Mutex
3
3
 
4
4
  [![Build Status](https://secure.travis-ci.org/kenn/redis-mutex.png)](http://travis-ci.org/kenn/redis-mutex)
5
5
 
6
- Distrubuted mutex in Ruby using Redis. Supports both **blocking** and **non-blocking** semantics.
6
+ Distributed mutex in Ruby using Redis. Supports both **blocking** and **non-blocking** semantics.
7
7
 
8
8
  The idea was taken from [the official SETNX doc](http://redis.io/commands/setnx).
9
9
 
@@ -45,7 +45,7 @@ class RedisMutex < RedisClassy
45
45
  now = Time.now.to_f
46
46
  @expires_at = now + @expire # Extend in each blocking loop
47
47
 
48
- loop do
48
+ begin
49
49
  return true if setnx(@expires_at) # Success, the lock has been acquired
50
50
  end until old_value = get # Repeat if unlocked before get
51
51
 
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "redis-mutex"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = '4.0.0' # retrieve this value by: Gem.loaded_specs['redis-mutex'].version.to_s
15
+ gem.version = '4.0.1' # retrieve this value by: Gem.loaded_specs['redis-mutex'].version.to_s
16
16
 
17
17
  gem.add_runtime_dependency "redis-classy", "~> 2.0"
18
18
  gem.add_development_dependency "rspec"
@@ -155,7 +155,6 @@ describe RedisMutex do
155
155
 
156
156
  def run(id)
157
157
  print "invoked worker #{id}...\n"
158
- RedisClassy.redis.client.reconnect
159
158
  mutex = RedisMutex.new(:test_lock, :expire => 1, :block => 10, :sleep => 0.01)
160
159
  result = 0
161
160
  LOOP_NUM.times do |i|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-mutex
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-24 00:00:00.000000000 Z
11
+ date: 2017-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-classy
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.2.2
109
+ rubygems_version: 2.6.14
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Distrubuted mutex using Redis