rabbit-wq 1.2.0 → 1.2.1
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/README.md +4 -0
- data/lib/rabbit_wq/version.rb +1 -1
- data/lib/rabbit_wq/work.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e4c00af6d964d22dd58180974cf52b007fc59ef
|
4
|
+
data.tar.gz: c8e5e2a226d8b0aa58adfb9f22686591a23b0588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7625da48b83e72d4335fa966633e46b90e4ffd902ce410101f08cc2fdd996a185d97cc52836699eb32d782e7d613b537e4ead26d0297e0d28df9c97783bcc2b
|
7
|
+
data.tar.gz: 1c246a82679d7892e2ea948b2fd14bcdf413669e51aa68583aa93db1b3ffca575e1f3e18b3bf0af2773071bd1844e6b6a49592c3db7e92cb03f05a467cef5bf6
|
data/README.md
CHANGED
@@ -153,6 +153,7 @@ Here is an example configuration file with each option's default value:
|
|
153
153
|
"threads": 1,
|
154
154
|
"time_zone": "UTC",
|
155
155
|
"work_exchange": "work",
|
156
|
+
"work_exchange_type": "fanout",
|
156
157
|
"work_log_level": "info",
|
157
158
|
"work_log_path": "/var/log/rabbit-wq/rabbit-wq-work.log",
|
158
159
|
"work_queue": "work"
|
@@ -184,6 +185,9 @@ The time zone to use with ActiveRecord.
|
|
184
185
|
#####work_exchange
|
185
186
|
The name of the work exchange. Defaults to work.
|
186
187
|
|
188
|
+
#####work_exchange_type
|
189
|
+
The RabbitMQ exchange type of the work exchange. Defaults to fanout. For more information see [RabbitMQ Docs](https://www.rabbitmq.com/tutorials/amqp-concepts.html).
|
190
|
+
|
187
191
|
#####work_log_level
|
188
192
|
The log level of the worker logger. Defaults to info.
|
189
193
|
|
data/lib/rabbit_wq/version.rb
CHANGED
data/lib/rabbit_wq/work.rb
CHANGED
@@ -15,7 +15,10 @@ module RabbitWQ
|
|
15
15
|
if delay
|
16
16
|
with_channel do |channel|
|
17
17
|
delay_x = channel.direct( "#{RabbitWQ.configuration.delayed_exchange_prefix}-#{delay}ms", durable: true )
|
18
|
-
|
18
|
+
|
19
|
+
work_x = channel.send( RabbitWQ.configuration.work_exchange_type,
|
20
|
+
RabbitWQ.configuration.work_exchange,
|
21
|
+
durable: true )
|
19
22
|
|
20
23
|
channel.queue( "#{RabbitWQ.configuration.delayed_queue_prefix}-#{delay}ms",
|
21
24
|
durable: true,
|
@@ -50,7 +53,10 @@ module RabbitWQ
|
|
50
53
|
def self.with_work_exchange
|
51
54
|
with_channel do |channel|
|
52
55
|
begin
|
53
|
-
exchange = channel.
|
56
|
+
exchange = channel.send( RabbitWQ.configuration.work_exchange_type,
|
57
|
+
RabbitWQ.configuration.work_exchange,
|
58
|
+
durable: true )
|
59
|
+
|
54
60
|
channel.queue( RabbitWQ.configuration.work_queue, durable: true ).tap do |q|
|
55
61
|
q.bind( exchange )
|
56
62
|
yield exchange, q
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit-wq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C. Jason Harrelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|