rabbit_jobs 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
@@ -151,6 +151,13 @@ module RabbitJobs
|
|
151
151
|
@data[:queues].keys
|
152
152
|
end
|
153
153
|
|
154
|
+
def init_default_queue
|
155
|
+
queue('default', DEFAULT_QUEUE_PARAMS) if @data[:queues].empty?
|
156
|
+
key = @data[:queues].keys.first
|
157
|
+
end
|
158
|
+
|
159
|
+
alias_method :default_queue, :init_default_queue
|
160
|
+
|
154
161
|
def queue_name(routing_key)
|
155
162
|
[@data[:exchange], routing_key].join('#')
|
156
163
|
end
|
@@ -12,9 +12,7 @@ module RabbitJobs
|
|
12
12
|
extend AmqpHelpers
|
13
13
|
|
14
14
|
def publish(klass, *params)
|
15
|
-
RJ.config.
|
16
|
-
key = RJ.config.routing_keys.first
|
17
|
-
publish_to(key, klass, *params)
|
15
|
+
publish_to(RJ.config.default_queue, klass, *params)
|
18
16
|
end
|
19
17
|
|
20
18
|
def publish_to(routing_key, klass, *params)
|
data/lib/rabbit_jobs/version.rb
CHANGED
data/lib/rabbit_jobs/worker.rb
CHANGED
@@ -18,6 +18,7 @@ module RabbitJobs
|
|
18
18
|
# in alphabetical order. Queues can be dynamically added or
|
19
19
|
# removed without needing to restart workers using this method.
|
20
20
|
def initialize(*queues)
|
21
|
+
RJ.config.init_default_queue
|
21
22
|
@queues = queues.map { |queue| queue.to_s.strip }.flatten.uniq
|
22
23
|
if @queues == ['*'] || @queues.empty?
|
23
24
|
@queues = RabbitJobs.config.routing_keys
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
segments:
|
131
131
|
- 0
|
132
|
-
hash:
|
132
|
+
hash: -224029628042723631
|
133
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
134
|
none: false
|
135
135
|
requirements:
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
segments:
|
140
140
|
- 0
|
141
|
-
hash:
|
141
|
+
hash: -224029628042723631
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
144
|
rubygems_version: 1.8.24
|