qmore 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/.travis.yml +5 -0
- data/CHANGELOG +4 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +118 -0
- data/Rakefile +2 -0
- data/config.ru +8 -0
- data/lib/qmore-server.rb +5 -0
- data/lib/qmore.rb +22 -0
- data/lib/qmore/attributes.rb +191 -0
- data/lib/qmore/job_reserver.rb +37 -0
- data/lib/qmore/server.rb +93 -0
- data/lib/qmore/server/views/dynamicqueues.erb +64 -0
- data/lib/qmore/server/views/priorities.erb +78 -0
- data/lib/qmore/version.rb +3 -0
- data/qmore.gemspec +33 -0
- data/spec/attributes_spec.rb +235 -0
- data/spec/job_reserver_spec.rb +87 -0
- data/spec/redis-test.conf +312 -0
- data/spec/server_spec.rb +237 -0
- data/spec/spec_helper.rb +49 -0
- metadata +172 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'qmore'
|
3
|
+
|
4
|
+
# No need to start redis when running in Travis
|
5
|
+
unless ENV['CI']
|
6
|
+
|
7
|
+
begin
|
8
|
+
Qmore.client.queues.counts
|
9
|
+
rescue Errno::ECONNREFUSED
|
10
|
+
spec_dir = File.dirname(File.expand_path(__FILE__))
|
11
|
+
REDIS_CMD = "redis-server #{spec_dir}/redis-test.conf"
|
12
|
+
|
13
|
+
puts "Starting redis for testing at localhost..."
|
14
|
+
puts `cd #{spec_dir}; #{REDIS_CMD}`
|
15
|
+
|
16
|
+
# Schedule the redis server for shutdown when tests are all finished.
|
17
|
+
at_exit do
|
18
|
+
puts 'Stopping redis'
|
19
|
+
pid = File.read("#{spec_dir}/redis.pid").to_i rescue nil
|
20
|
+
system ("kill -9 #{pid}") if pid.to_i != 0
|
21
|
+
File.delete("#{spec_dir}/redis.pid") rescue nil
|
22
|
+
File.delete("#{spec_dir}/redis-server.log") rescue nil
|
23
|
+
File.delete("#{spec_dir}/dump.rdb") rescue nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def dump_redis
|
30
|
+
result = {}
|
31
|
+
redis = Qmore.client.redis
|
32
|
+
redis.keys("*").each do |key|
|
33
|
+
type = redis.type(key)
|
34
|
+
result["#{key} (#{type})"] = case type
|
35
|
+
when 'string' then redis.get(key)
|
36
|
+
when 'list' then redis.lrange(key, 0, -1)
|
37
|
+
when 'zset' then redis.zrange(key, 0, -1, :with_scores => true)
|
38
|
+
when 'set' then redis.smembers(key)
|
39
|
+
when 'hash' then redis.hgetall(key)
|
40
|
+
else type
|
41
|
+
end
|
42
|
+
end
|
43
|
+
return result
|
44
|
+
end
|
45
|
+
|
46
|
+
class SomeJob
|
47
|
+
def self.perform(*args)
|
48
|
+
end
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: qmore
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matt Conway
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-06-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: qless
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.9.3
|
21
|
+
none: false
|
22
|
+
prerelease: false
|
23
|
+
type: :runtime
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 0.9.3
|
29
|
+
none: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: multi_json
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ~>
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 1.7.7
|
37
|
+
none: false
|
38
|
+
prerelease: false
|
39
|
+
type: :runtime
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.7.7
|
45
|
+
none: false
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
none: false
|
54
|
+
prerelease: false
|
55
|
+
type: :development
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
none: false
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.5'
|
69
|
+
none: false
|
70
|
+
prerelease: false
|
71
|
+
type: :development
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '2.5'
|
77
|
+
none: false
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rack-test
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 0.5.4
|
85
|
+
none: false
|
86
|
+
prerelease: false
|
87
|
+
type: :development
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ~>
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 0.5.4
|
93
|
+
none: false
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: orderedhash
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
none: false
|
102
|
+
prerelease: false
|
103
|
+
type: :development
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ! '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
none: false
|
110
|
+
description: Qmore allows one to specify the queues a worker processes by the use
|
111
|
+
of wildcards, negations, or dynamic look up from redis. It also allows one to specify
|
112
|
+
the relative priority between queues (rather than within a single queue). It plugs
|
113
|
+
into the Qless webapp to make it easy to manage the queues.
|
114
|
+
email:
|
115
|
+
- matt@conwaysplace.com
|
116
|
+
executables: []
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- .gitignore
|
121
|
+
- .travis.yml
|
122
|
+
- CHANGELOG
|
123
|
+
- Gemfile
|
124
|
+
- LICENSE
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- config.ru
|
128
|
+
- lib/qmore-server.rb
|
129
|
+
- lib/qmore.rb
|
130
|
+
- lib/qmore/attributes.rb
|
131
|
+
- lib/qmore/job_reserver.rb
|
132
|
+
- lib/qmore/server.rb
|
133
|
+
- lib/qmore/server/views/dynamicqueues.erb
|
134
|
+
- lib/qmore/server/views/priorities.erb
|
135
|
+
- lib/qmore/version.rb
|
136
|
+
- qmore.gemspec
|
137
|
+
- spec/attributes_spec.rb
|
138
|
+
- spec/job_reserver_spec.rb
|
139
|
+
- spec/redis-test.conf
|
140
|
+
- spec/server_spec.rb
|
141
|
+
- spec/spec_helper.rb
|
142
|
+
homepage: ''
|
143
|
+
licenses: []
|
144
|
+
post_install_message:
|
145
|
+
rdoc_options: []
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ! '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
none: false
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
none: false
|
160
|
+
requirements: []
|
161
|
+
rubyforge_project: qmore
|
162
|
+
rubygems_version: 1.8.25
|
163
|
+
signing_key:
|
164
|
+
specification_version: 3
|
165
|
+
summary: A qless plugin that gives more control over how queues are processed
|
166
|
+
test_files:
|
167
|
+
- spec/attributes_spec.rb
|
168
|
+
- spec/job_reserver_spec.rb
|
169
|
+
- spec/redis-test.conf
|
170
|
+
- spec/server_spec.rb
|
171
|
+
- spec/spec_helper.rb
|
172
|
+
has_rdoc:
|