qmore 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/lib/qmore/job_reserver.rb +17 -22
- data/lib/qmore/version.rb +1 -1
- metadata +22 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9d6985db5a99abfa48c462c2638045392a0875a
|
4
|
+
data.tar.gz: 62f812029aa3893e69e18fa63a9f6cc7d63eb4b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76cf53aa0c4ab81a0d43e022cda344c84ea26608cde4919ef2fd74a00028115d2f045aada331356ac28a5023ff2c416a9dcaf3375ebc010cc3fddbb669e6584f
|
7
|
+
data.tar.gz: afd87b60e42ea01749703ed114a461ad724268e40bce3748c27c8ee7a742ce34c2626f83c1e970081ee9d4256a0fd922b0c81c9ba508e4ea2aadfd689c8ef3ef
|
data/CHANGELOG
CHANGED
data/lib/qmore/job_reserver.rb
CHANGED
@@ -26,38 +26,33 @@ module Qmore
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def reserve
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
self.clients.keys.shuffle.each do |client|
|
30
|
+
self.extract_queues(client, self.clients[client]).each do |q|
|
31
|
+
job = q.pop
|
32
|
+
return job if job
|
33
|
+
end
|
32
34
|
end
|
33
35
|
|
34
36
|
nil
|
35
37
|
end
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
def realize_queues
|
40
|
-
realized_queues = []
|
39
|
+
protected
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
actual_queues = client.queues
|
41
|
+
def extract_queues(client, regexes)
|
42
|
+
# Cache the queues so we don't make multiple calls.
|
43
|
+
actual_queues = client.queues
|
46
44
|
|
47
|
-
|
48
|
-
|
45
|
+
# Grab all the actual queue names from the client.
|
46
|
+
queue_names = actual_queues.counts.collect {|h| h['name'] }
|
49
47
|
|
50
|
-
|
51
|
-
|
48
|
+
# Match the queue names against the regexes provided.
|
49
|
+
matched_names = expand_queues(regexes, queue_names)
|
52
50
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
# add the matched queues to the resulting list.
|
57
|
-
realized_queues.concat(prioritized_names.collect {|name| actual_queues[name] })
|
58
|
-
end
|
51
|
+
# Prioritize the queues.
|
52
|
+
prioritized_names = prioritize_queues(get_priority_buckets, matched_names)
|
59
53
|
|
60
|
-
|
54
|
+
# collect the matched queues names in prioritized order.
|
55
|
+
prioritized_names.collect {|name| actual_queues[name] }
|
61
56
|
end
|
62
57
|
end
|
63
58
|
end
|
data/lib/qmore/version.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qmore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Conway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: qless
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack-test
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: orderedhash
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: Qmore allows one to specify the queues a worker processes by the use
|
@@ -118,8 +118,8 @@ executables: []
|
|
118
118
|
extensions: []
|
119
119
|
extra_rdoc_files: []
|
120
120
|
files:
|
121
|
-
- .gitignore
|
122
|
-
- .travis.yml
|
121
|
+
- ".gitignore"
|
122
|
+
- ".travis.yml"
|
123
123
|
- CHANGELOG
|
124
124
|
- Gemfile
|
125
125
|
- LICENSE
|
@@ -150,17 +150,17 @@ require_paths:
|
|
150
150
|
- lib
|
151
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
152
|
requirements:
|
153
|
-
- -
|
153
|
+
- - ">="
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- -
|
158
|
+
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project: qmore
|
163
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.2.2
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: A qless plugin that gives more control over how queues are processed
|
@@ -171,3 +171,4 @@ test_files:
|
|
171
171
|
- spec/redis/qless02-test.conf
|
172
172
|
- spec/server_spec.rb
|
173
173
|
- spec/spec_helper.rb
|
174
|
+
has_rdoc:
|