sneakers-laces 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sneakers/laces/queue_manager.rb +12 -3
- data/lib/sneakers/laces/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1baa8d6fe1ebbe25b55a7f1136054fb2468b55b78d0b7543330fde137a12d2d
|
4
|
+
data.tar.gz: 1e013256481dcf1c835457bd75a689e163dd7a809f46c7885824b0cd47a3cf94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d5365623de783f812b17878c7768b49f092faeca73bfadd08b22c96d7bdc8fa8024cfc8800b46a44d6ffb8eeebfb4c5d29229389777c8c993e0450988ccb1d6
|
7
|
+
data.tar.gz: fae5638072c5b67608c9dd099ae87b5e2c1675eadcaa01435eca865354139273649455bd9049f463699d83b20b79b825c2ed7239bd2d9ed28e71174c7b9b5d26
|
@@ -10,7 +10,7 @@ module Sneakers
|
|
10
10
|
def declare_queue(name:, worker_tag:, routing_key: nil, binding_arguments: [], params: {}, reload: true)
|
11
11
|
api_client.declare_queue vhost,
|
12
12
|
name,
|
13
|
-
|
13
|
+
params_for_queue(name, worker_tag, params)
|
14
14
|
|
15
15
|
api_client.bind_queue(vhost, name, exchange, (routing_key || name), binding_arguments)
|
16
16
|
|
@@ -78,9 +78,10 @@ module Sneakers
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
-
def
|
81
|
+
def params_for_queue(name, worker_tag, params = {})
|
82
82
|
Sneakers::CONFIG.fetch(:queue_options).merge(params.deep_symbolize_keys).tap do |p|
|
83
|
-
p[:arguments][WORKER_TAG_ARGUMENT]
|
83
|
+
p[:arguments][WORKER_TAG_ARGUMENT] = worker_tag
|
84
|
+
p[:arguments]['x-dead-letter-exchange'] = retry_exchange_name(name) if maxretry_handler_enabled?
|
84
85
|
end
|
85
86
|
end
|
86
87
|
|
@@ -95,6 +96,14 @@ module Sneakers
|
|
95
96
|
def exchange
|
96
97
|
Sneakers::CONFIG.fetch(:exchange)
|
97
98
|
end
|
99
|
+
|
100
|
+
def retry_exchange_name(name)
|
101
|
+
[name, 'retry'].join('-')
|
102
|
+
end
|
103
|
+
|
104
|
+
def maxretry_handler_enabled?
|
105
|
+
Sneakers::CONFIG[:handler] && Sneakers::CONFIG[:handler].name == 'Sneakers::Handlers::Maxretry'
|
106
|
+
end
|
98
107
|
end
|
99
108
|
end
|
100
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sneakers-laces
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Sharshenov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|