turnpike 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/turnpike/queue.rb +2 -2
- data/lib/turnpike/unique_queue.rb +3 -6
- data/lib/turnpike/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bef65c2725cc692f91f86c187db23d3dc7250e7
|
4
|
+
data.tar.gz: 3fddd1e0fc075d820b9ae6c00b006e42bfe0e599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18f0f8e0481d419b622a86d708850694f6254063a954d4b4523dfeafda8f8fd48eef7699a89419f7675a0f0bde9b881dc43302b0927f8fcdd2050ca9aa234c5b
|
7
|
+
data.tar.gz: d6358963988ee4e42a24c6b7bc887c2d147cd65c776361296746c662a94a2e329c2d6596459966b9b7b76a3d6f543dd948caea8836c418be2d9973cb3f96c87c
|
data/lib/turnpike/queue.rb
CHANGED
@@ -21,7 +21,7 @@ module Turnpike
|
|
21
21
|
#
|
22
22
|
# items - A splat Array of items.
|
23
23
|
#
|
24
|
-
# Returns
|
24
|
+
# Returns nothing.
|
25
25
|
def push(*items)
|
26
26
|
redis.rpush(name, items.map { |i| pack(i) })
|
27
27
|
end
|
@@ -37,7 +37,7 @@ module Turnpike
|
|
37
37
|
#
|
38
38
|
# items - A splat Array of items.
|
39
39
|
#
|
40
|
-
# Returns
|
40
|
+
# Returns nothing.
|
41
41
|
def unshift(*items)
|
42
42
|
redis.lpush(name, items.map { |i| pack(i) })
|
43
43
|
end
|
@@ -31,12 +31,9 @@ module Turnpike
|
|
31
31
|
#
|
32
32
|
# items - A splat Array of items.
|
33
33
|
#
|
34
|
-
# Returns
|
34
|
+
# Returns nothing.
|
35
35
|
def push(*items, score: Time.now.to_f)
|
36
|
-
redis.
|
37
|
-
redis.zadd(name, items.reduce([]) { |ary, i| ary.push(score, pack(i)) })
|
38
|
-
size
|
39
|
-
end
|
36
|
+
redis.zadd(name, items.reduce([]) { |ary, i| ary.push(score, pack(i)) })
|
40
37
|
end
|
41
38
|
|
42
39
|
alias << push
|
@@ -50,7 +47,7 @@ module Turnpike
|
|
50
47
|
#
|
51
48
|
# items - A splat Array of items.
|
52
49
|
#
|
53
|
-
# Returns
|
50
|
+
# Returns nothing.
|
54
51
|
def unshift(*items)
|
55
52
|
_, score = redis.zrange(name, 0, 0, with_scores: true).pop
|
56
53
|
score ? push(*items, score: score - 1) : push(*items)
|
data/lib/turnpike/version.rb
CHANGED