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 +4 -4
- data/.travis.yml +6 -4
- data/README.md +1 -1
- data/lib/redis_mutex.rb +1 -1
- data/redis-mutex.gemspec +1 -1
- data/spec/redis_mutex_spec.rb +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae1c89915620c81811eee75220df0e12ed90fd3e
|
4
|
+
data.tar.gz: 0bde420a795d1dece14c400ebe9a47943492aed2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60c210cae1d61688157c5d028b9f39af6bfdd8341f9aa76197c34bc755ed9f9625113e978b2c7ca2bf57bb88f1963b044abc4e603b2a8e3ef15aefb65e7dd7de
|
7
|
+
data.tar.gz: 9b04bdb81b5d38e08a09b66666325a8c7f916ae110866e09c102534a14bef2553a8a6527f4215388e98a04c67ab34ba94cf45f1605dba03eef7a62b3bf8cbfdb
|
data/.travis.yml
CHANGED
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
|
-
|
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
|
|
data/lib/redis_mutex.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/redis-mutex.gemspec
CHANGED
@@ -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.
|
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"
|
data/spec/redis_mutex_spec.rb
CHANGED
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.
|
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:
|
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.
|
109
|
+
rubygems_version: 2.6.14
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Distrubuted mutex using Redis
|