coordinator 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/coordinator/base.rb +2 -2
- data/lib/coordinator/queue.rb +4 -2
- data/lib/coordinator/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: f66708844197caa57e7e913f69c715efcb652dc9
|
4
|
+
data.tar.gz: d5cd8fed2ad8715ab68ea8acaede0b21c72f81d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0da397ca8c9462beb8b3ab3beb8ecd1e7864ca72a671e8f883c136fc74e54e6823eb19f9bca3b62b582064a42ddd2b1079abf704ed777a22617699e1a6f857fd
|
7
|
+
data.tar.gz: bd1ec9dd92c33e236ab1ba51215782485ab8f6772a6f31d0992398a456745d567f57311c7f5e8e4098861a6390a60b4c1c3281f130d58c5529fb0f9b8f46afc8
|
data/lib/coordinator/base.rb
CHANGED
@@ -31,7 +31,7 @@ module Coordinator
|
|
31
31
|
def info(skill)
|
32
32
|
queue = queue_for_skill(skill)
|
33
33
|
{
|
34
|
-
:
|
34
|
+
:name => queue.name,
|
35
35
|
:capacity => queue.capacity,
|
36
36
|
:count => queue.length,
|
37
37
|
:items => queue.items
|
@@ -41,7 +41,7 @@ module Coordinator
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def queue_for_skill(skill)
|
44
|
-
queue = @queues.find {|q| q.
|
44
|
+
queue = @queues.find {|q| q.name == skill}
|
45
45
|
raise Coordinator::Error, "No matching queue for #{skill}" unless queue
|
46
46
|
queue
|
47
47
|
end
|
data/lib/coordinator/queue.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
module Coordinator
|
2
2
|
class Queue
|
3
|
-
attr_reader :skill, :rules
|
4
|
-
|
5
3
|
def initialize(skill, capacity=nil, &block)
|
6
4
|
@skill = skill
|
7
5
|
@store = Coordinator::RedisQueue.new(@skill)
|
@@ -40,6 +38,10 @@ module Coordinator
|
|
40
38
|
@store.capacity = capacity
|
41
39
|
end
|
42
40
|
|
41
|
+
def name
|
42
|
+
@skill
|
43
|
+
end
|
44
|
+
|
43
45
|
def items
|
44
46
|
@store.items
|
45
47
|
end
|
data/lib/coordinator/version.rb
CHANGED