advanced-sneakers-activejob 0.3.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +79 -44
- data/README.md +23 -5
- data/lib/active_job/queue_adapters/advanced_sneakers_adapter.rb +13 -5
- data/lib/advanced_sneakers_activejob/active_job_patch.rb +9 -1
- data/lib/advanced_sneakers_activejob/configuration.rb +6 -2
- data/lib/advanced_sneakers_activejob/delayed_publisher.rb +11 -11
- data/lib/advanced_sneakers_activejob/handler.rb +1 -7
- data/lib/advanced_sneakers_activejob/publisher.rb +2 -2
- data/lib/advanced_sneakers_activejob/tasks.rb +1 -1
- data/lib/advanced_sneakers_activejob/version.rb +1 -1
- data/lib/advanced_sneakers_activejob.rb +8 -3
- metadata +25 -46
- data/.gitignore +0 -23
- data/.rspec +0 -2
- data/.rubocop.yml +0 -42
- data/.travis.yml +0 -21
- data/Gemfile +0 -11
- data/Rakefile +0 -8
- data/advanced-sneakers-activejob.gemspec +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d76d72ecda9caf10d961a1489214fb54a19b336fb2bfaa20c0db2678e06a36e0
|
4
|
+
data.tar.gz: 22ce99262256a1e7715ad56ea901163ea6a88ac66c9f6b4df0c457dc3c8633a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 682edc7c6a50785943662fd7350881df2808a942eb0101b92e4cdefcc44e37481be1b791af4ed9d7af38939e2554a748ab836ec2daa4ec936688b19201de56ef
|
7
|
+
data.tar.gz: de2fcbb80cfcb3d011334355aad8d09532d497b1151b11b2407d42435b967b5154e488f058324bcfb496e7279637c7d0c93fc16bdcc31d34c190adf6bfd07603
|
data/CHANGELOG.md
CHANGED
@@ -1,76 +1,111 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
|
6
|
-
NoMethodError: undefined method `message_options' for MyJob:Class
|
7
|
-
```
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
8
6
|
|
9
|
-
##
|
7
|
+
## [Unreleased](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.6.0...HEAD)
|
10
8
|
|
11
|
-
### [Support for wildcards to run ActiveJob consumers by queues](https://github.com/veeqo/advanced-sneakers-activejob/pull/10)
|
12
9
|
|
13
|
-
|
10
|
+
## [0.6.0](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.5.0...v0.6.0) - 2022-02-15
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
### Added
|
13
|
+
- [#24](https://github.com/veeqo/advanced-sneakers-activejob/pull/24) Test with ruby 3 and ActiveJob v6.1
|
14
|
+
- [#26](https://github.com/veeqo/advanced-sneakers-activejob/pull/26) Make log level to be configurable
|
15
|
+
- [#30](https://github.com/veeqo/advanced-sneakers-activejob/pull/30) Add support for ActiveJob v7.0
|
18
16
|
|
19
|
-
|
17
|
+
### Changed
|
18
|
+
- [#22](https://github.com/veeqo/advanced-sneakers-activejob/pull/22) Migrate from Travis to Github Actions
|
20
19
|
|
21
|
-
###
|
20
|
+
### Removed
|
21
|
+
- [#27](https://github.com/veeqo/advanced-sneakers-activejob/pull/27) Drop support of rubies older than 2.5
|
22
22
|
|
23
|
-
Works with `sneakers:active_job` task only!
|
24
23
|
|
25
|
-
|
26
|
-
QUEUES=mailers,default rake sneakers:active_job
|
27
|
-
```
|
24
|
+
## [0.5.0](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.4.0...v0.5.0) - 2020-11-30
|
28
25
|
|
29
|
-
|
26
|
+
### Changed
|
27
|
+
- [#16](https://github.com/veeqo/advanced-sneakers-activejob/pull/16) Switch to bunny-publisher v0.2 (drops republish connection)
|
30
28
|
|
31
|
-
### [Add ability to run specified ActiveJob queues consumers](https://github.com/veeqo/advanced-sneakers-activejob/pull/8)
|
32
29
|
|
33
|
-
|
30
|
+
## [0.4.0](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.3.6...v0.4.0) - 2020-11-17
|
34
31
|
|
35
|
-
|
36
|
-
|
37
|
-
```
|
32
|
+
### Added
|
33
|
+
- [#15](https://github.com/veeqo/advanced-sneakers-activejob/pull/15) Add ability to set AMQP message options per job
|
38
34
|
|
39
|
-
Now it works for ActiveJob queues consumers as well:
|
40
35
|
|
41
|
-
|
42
|
-
WORKERS=AdvancedSneakersActiveJob::MailersConsumer rake sneakers:run
|
43
|
-
```
|
36
|
+
## [0.3.6](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.3.5...v0.3.6) - 2020-09-18
|
44
37
|
|
45
|
-
|
38
|
+
### Changed
|
39
|
+
- [#12](https://github.com/veeqo/advanced-sneakers-activejob/pull/12) Refactor changelog to comply with Keep a Changelog
|
40
|
+
- [#13](https://github.com/veeqo/advanced-sneakers-activejob/pull/13) Use appraisals for Travis matrix
|
46
41
|
|
47
|
-
###
|
42
|
+
### Fixed
|
43
|
+
- [#14](https://github.com/veeqo/advanced-sneakers-activejob/pull/14) Fix deprecation warnings of ruby 2.7
|
48
44
|
|
49
|
-
## Changes Between 0.2.3 and 0.3.0
|
50
45
|
|
51
|
-
|
46
|
+
## [0.3.5](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.3.4...v0.3.5) - 2020-06-27
|
52
47
|
|
53
|
-
###
|
48
|
+
### Fixed
|
49
|
+
- [#11](https://github.com/veeqo/advanced-sneakers-activejob/pull/11) `NoMethodError` on `Rails.application.eager_load!` in Rails initializer
|
54
50
|
|
55
|
-
## Changes Between 0.2.2 and 0.2.3
|
56
51
|
|
57
|
-
|
58
|
-
### [Support for custom adapter per job](https://github.com/veeqo/advanced-sneakers-activejob/pull/4)
|
52
|
+
## [0.3.4](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.3.3...v0.3.4) - 2020-06-11
|
59
53
|
|
60
|
-
|
54
|
+
### Added
|
55
|
+
- [#10](https://github.com/veeqo/advanced-sneakers-activejob/pull/10) Ability to run ActiveJob consumers by wildcards for queue names
|
61
56
|
|
62
|
-
Cleanup of `puts` and logger mistakenly introduced in previous version
|
63
57
|
|
64
|
-
##
|
58
|
+
## [0.3.3](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.3.2...v0.3.3) - 2020-06-09
|
65
59
|
|
66
|
-
###
|
60
|
+
### Added
|
61
|
+
- [#9](https://github.com/veeqo/advanced-sneakers-activejob/pull/9) Ability to run ActiveJob consumers by queue names
|
67
62
|
|
68
|
-
Fixed worker class name in rake task description
|
69
63
|
|
70
|
-
##
|
64
|
+
## [0.3.2](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.3.1...v0.3.2) - 2020-06-05
|
71
65
|
|
72
|
-
###
|
66
|
+
### Added
|
67
|
+
- [#8](https://github.com/veeqo/advanced-sneakers-activejob/pull/8) Ability to run specified ActiveJob queues consumers
|
73
68
|
|
74
|
-
Customizable options for message publishing (`routing_key`, `headers`, etc)
|
75
69
|
|
76
|
-
##
|
70
|
+
## [0.3.1](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.3.0...v0.3.1) - 2020-06-02
|
71
|
+
|
72
|
+
### Fixed
|
73
|
+
- [#6](https://github.com/veeqo/advanced-sneakers-activejob/pull/6) Restore Sneakers::Worker::Classes methods
|
74
|
+
|
75
|
+
|
76
|
+
## [0.3.0](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.2.3...v0.3.0) - 2020-05-21
|
77
|
+
|
78
|
+
### Changed
|
79
|
+
- [#5](https://github.com/veeqo/advanced-sneakers-activejob/pull/5) Publisher is extracted to [bunny-publisher](https://github.com/veeqo/bunny-publisher)
|
80
|
+
|
81
|
+
|
82
|
+
## [0.2.3](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.2.2...v0.2.3) - 2020-04-06
|
83
|
+
|
84
|
+
### Added
|
85
|
+
- [#4](https://github.com/veeqo/advanced-sneakers-activejob/pull/4) Support for custom adapter per job
|
86
|
+
|
87
|
+
### Changed
|
88
|
+
- [#3](https://github.com/veeqo/advanced-sneakers-activejob/pull/3) Refactored support for ActiveJob prefix
|
89
|
+
|
90
|
+
|
91
|
+
## [0.2.2](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.2.1...v0.2.2) - 2020-04-05
|
92
|
+
|
93
|
+
### Fixed
|
94
|
+
- Cleanup of `puts` and logger mistakenly introduced in version `0.2.1`
|
95
|
+
|
96
|
+
## [0.2.1](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.2.0...v0.2.1) - 2020-04-05
|
97
|
+
|
98
|
+
### Added
|
99
|
+
- [#2](https://github.com/veeqo/advanced-sneakers-activejob/pull/2) Support queue name prefixes
|
100
|
+
|
101
|
+
|
102
|
+
## [0.2.0](https://github.com/veeqo/advanced-sneakers-activejob/compare/v0.1.0...v0.2.0) - 2020-03-23
|
103
|
+
|
104
|
+
### Added
|
105
|
+
- [#1](https://github.com/veeqo/advanced-sneakers-activejob/pull/1) Customizable options for message publishing (`routing_key`, `headers`, etc)
|
106
|
+
|
107
|
+
|
108
|
+
## [0.1.0](https://github.com/veeqo/advanced-sneakers-activejob/releases/tag/v0.1.0) - 2020-03-19
|
109
|
+
|
110
|
+
### Added
|
111
|
+
- `:advanced_sneakers` adapter for ActiveJob
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# `:advanced_sneakers` adapter for ActiveJob
|
2
|
-
[![Build Status](https://
|
2
|
+
[![Build Status](https://github.com/veeqo/advanced-sneakers-activejob/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/veeqo/advanced-sneakers-activejob/actions/workflows/main.yml) [![Gem Version](https://badge.fury.io/rb/advanced-sneakers-activejob.svg)](https://badge.fury.io/rb/advanced-sneakers-activejob)
|
3
3
|
|
4
4
|
Drop-in replacement for `:sneakers` adapter of ActiveJob. Extra features:
|
5
5
|
|
@@ -11,6 +11,12 @@ Drop-in replacement for `:sneakers` adapter of ActiveJob. Extra features:
|
|
11
11
|
6. [Exponential backoff\*](#exponential-backoff)
|
12
12
|
7. Exposes [`#delivery_info` & `#headers`](#amqp-metadata) AMQP metadata to job
|
13
13
|
|
14
|
+
<p align="center">
|
15
|
+
<a href="https://www.veeqo.com/" title="Sponsored by Veeqo">
|
16
|
+
<img src="https://static.veeqo.com/assets/sponsored_by_veeqo.png" width="360" />
|
17
|
+
</a>
|
18
|
+
</p>
|
19
|
+
|
14
20
|
## Installation
|
15
21
|
|
16
22
|
Add this line to your application's Gemfile:
|
@@ -66,7 +72,7 @@ Take into accout that **this process is asynchronous**. It means that in case of
|
|
66
72
|
|
67
73
|
## Custom message options
|
68
74
|
|
69
|
-
Advanced sneakers adapter allows to set custom message options (e.g. [routing keys](https://www.rabbitmq.com/tutorials/tutorial-four-ruby.html)).
|
75
|
+
Advanced sneakers adapter allows to set [custom message options](http://reference.rubybunny.info/Bunny/Exchange.html#publish-instance_method) (e.g. [routing keys](https://www.rabbitmq.com/tutorials/tutorial-four-ruby.html)) on class-level.
|
70
76
|
|
71
77
|
```ruby
|
72
78
|
class MyJob < ActiveJob::Base
|
@@ -96,6 +102,14 @@ class MyJob < ActiveJob::Base
|
|
96
102
|
end
|
97
103
|
```
|
98
104
|
|
105
|
+
And also supports custom message options per job
|
106
|
+
```ruby
|
107
|
+
MyJob.set(priority: 1, headers: { 'foo' => 'bar' }).perform_later('baz')
|
108
|
+
```
|
109
|
+
|
110
|
+
Read more about message properties:
|
111
|
+
- https://www.rabbitmq.com/publishers.html#message-properties
|
112
|
+
- http://reference.rubybunny.info/Bunny/Exchange.html#publish-instance_method
|
99
113
|
|
100
114
|
Take into accout that **custom message options are used for publishing only**.
|
101
115
|
|
@@ -174,8 +188,8 @@ AdvancedSneakersActiveJob.configure do |config|
|
|
174
188
|
# Connection for publisher (fallbacks to connection of consumers)
|
175
189
|
config.publish_connection = Bunny.new('CUSTOM_URL', with: { other: 'options' })
|
176
190
|
|
177
|
-
#
|
178
|
-
config.
|
191
|
+
# Log level of "rake sneakers:active_job" output
|
192
|
+
config.log_level = :info
|
179
193
|
end
|
180
194
|
```
|
181
195
|
|
@@ -187,4 +201,8 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/veeqo/
|
|
187
201
|
|
188
202
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
189
203
|
|
190
|
-
##
|
204
|
+
## About [Veeqo](https://www.veeqo.com)
|
205
|
+
|
206
|
+
At Veeqo, our team of Engineers is on a mission to create a world-class Inventory and Shipping platform, built to the highest standards in best coding practices. We are a growing team, looking for other passionate developers to [join us](https://veeqo-ltd.breezy.hr/) on our journey. If you're looking for a career working for one of the most exciting tech companies in ecommerce, we want to hear from you.
|
207
|
+
|
208
|
+
[Veeqo developers blog](https://devs.veeqo.com)
|
@@ -47,11 +47,7 @@ module ActiveJob
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def build_publish_params(job)
|
50
|
-
params = job
|
51
|
-
|
52
|
-
params.each do |key, value|
|
53
|
-
params[key] = value.call(job) if value.respond_to?(:call)
|
54
|
-
end
|
50
|
+
params = merged_publish_options(job)
|
55
51
|
|
56
52
|
unless params.key?(:routing_key)
|
57
53
|
params[:routing_key] = job.queue_name.respond_to?(:call) ? job.queue_name.call : job.queue_name
|
@@ -59,6 +55,18 @@ module ActiveJob
|
|
59
55
|
|
60
56
|
params
|
61
57
|
end
|
58
|
+
|
59
|
+
def merged_publish_options(job)
|
60
|
+
publish_options = job.class.publish_options.deep_dup || {}
|
61
|
+
|
62
|
+
publish_options.each do |key, value|
|
63
|
+
publish_options[key] = value.call(job) if value.respond_to?(:call)
|
64
|
+
end
|
65
|
+
|
66
|
+
publish_options.deep_merge!(job.publish_options) if job.publish_options.present?
|
67
|
+
|
68
|
+
publish_options
|
69
|
+
end
|
62
70
|
end
|
63
71
|
|
64
72
|
delegate :enqueue, :enqueue_at, to: :'ActiveJob::QueueAdapters::AdvancedSneakersAdapter' # compatibility with Rails 5+
|
@@ -6,7 +6,7 @@ module AdvancedSneakersActiveJob
|
|
6
6
|
|
7
7
|
included do
|
8
8
|
# AMQP message contains metadata which might be helpful for consumer (e.g. job.delivery_info.routing_key)
|
9
|
-
attr_accessor :delivery_info, :headers
|
9
|
+
attr_accessor :delivery_info, :headers, :publish_options
|
10
10
|
|
11
11
|
class_attribute :publish_options, instance_accessor: false
|
12
12
|
end
|
@@ -25,5 +25,13 @@ module AdvancedSneakersActiveJob
|
|
25
25
|
self.publish_options = options.symbolize_keys
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
def enqueue(options = {})
|
30
|
+
# Since ActiveJob v5 :priority option is supported natively https://github.com/rails/rails/pull/19425
|
31
|
+
# publish_options holds its own :priority to "backport" priority feature to ActiveJob v4
|
32
|
+
self.publish_options = options.except(:wait, :wait_until, :queue)
|
33
|
+
|
34
|
+
super
|
35
|
+
end
|
28
36
|
end
|
29
37
|
end
|
@@ -16,9 +16,13 @@ module AdvancedSneakersActiveJob
|
|
16
16
|
config_accessor(:delay_proc) { ->(timestamp) { (timestamp - Time.now.to_f).round } } # seconds
|
17
17
|
config_accessor(:delayed_queue_prefix) { 'delayed' }
|
18
18
|
config_accessor(:retry_delay_proc) { ->(count) { AdvancedSneakersActiveJob::EXPONENTIAL_BACKOFF[count] } } # seconds
|
19
|
+
config_accessor(:log_level) { :info } # debug logs are too noizy because of Bunny
|
19
20
|
|
20
21
|
config_accessor(:publish_connection)
|
21
|
-
|
22
|
+
|
23
|
+
def republish_connection=(_)
|
24
|
+
ActiveSupport::Deprecation.warn('Republish connection is not used for bunny-publisher v0.2+')
|
25
|
+
end
|
22
26
|
|
23
27
|
def sneakers
|
24
28
|
custom_config = DEFAULT_SNEAKERS_CONFIG.deep_merge(config.sneakers || {})
|
@@ -35,7 +39,7 @@ module AdvancedSneakersActiveJob
|
|
35
39
|
end
|
36
40
|
|
37
41
|
def publisher_config
|
38
|
-
sneakers.merge(publish_connection: publish_connection
|
42
|
+
sneakers.merge(publish_connection: publish_connection)
|
39
43
|
end
|
40
44
|
end
|
41
45
|
end
|
@@ -17,24 +17,20 @@ module AdvancedSneakersActiveJob
|
|
17
17
|
attr_reader :dlx_exchange_name
|
18
18
|
|
19
19
|
def initialize(exchange:, **options)
|
20
|
-
super(options.merge(exchange: [exchange, 'delayed'].join('-'), exchange_options: { type: 'headers', durable: true }))
|
20
|
+
super(**options.merge(exchange: [exchange, 'delayed'].join('-'), exchange_options: { type: 'headers', durable: true }))
|
21
21
|
|
22
22
|
@dlx_exchange_name = exchange
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
26
26
|
|
27
|
-
def log_message
|
27
|
+
def log_message
|
28
28
|
logger.debug do
|
29
|
-
|
30
|
-
|
31
|
-
"Publishing <#{message}> to [#{publisher.exchange.name}] with routing_key [#{options[:routing_key]}] and delay [#{delay}]"
|
29
|
+
"Publishing <#{message}> to [#{@exchange_name}] with routing_key [#{message_options[:routing_key]}] and delay [#{delay}]"
|
32
30
|
end
|
33
31
|
end
|
34
32
|
|
35
|
-
def declare_republish_queue
|
36
|
-
delay = properties.headers.fetch('delay')
|
37
|
-
|
33
|
+
def declare_republish_queue
|
38
34
|
queue_name = delayed_queue_name(delay: delay)
|
39
35
|
|
40
36
|
queue_arguments = {
|
@@ -45,11 +41,15 @@ module AdvancedSneakersActiveJob
|
|
45
41
|
|
46
42
|
logger.debug { "Creating delayed queue [#{queue_name}]" }
|
47
43
|
|
48
|
-
|
44
|
+
channel.queue(queue_name, durable: true, arguments: queue_arguments)
|
45
|
+
end
|
46
|
+
|
47
|
+
def delay
|
48
|
+
message_options.dig(:headers, 'delay')
|
49
49
|
end
|
50
50
|
|
51
|
-
def declare_republish_queue_binding(queue
|
52
|
-
queue.bind(
|
51
|
+
def declare_republish_queue_binding(queue)
|
52
|
+
queue.bind(exchange, arguments: { delay: delay })
|
53
53
|
end
|
54
54
|
|
55
55
|
def delayed_queue_name(delay:)
|
@@ -57,14 +57,8 @@ module AdvancedSneakersActiveJob
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def track_error_in_headers(headers, error)
|
60
|
-
details = if error.respond_to?(:full_message) # ruby 2.5+
|
61
|
-
error.full_message
|
62
|
-
else
|
63
|
-
([error.message] + error.backtrace).join("\n")
|
64
|
-
end
|
65
|
-
|
66
60
|
headers['x-last-error-name'] = error.class.name
|
67
|
-
headers['x-last-error-details'] = Base64.encode64(ActiveSupport::Gzip.compress(
|
61
|
+
headers['x-last-error-details'] = Base64.encode64(ActiveSupport::Gzip.compress(error.full_message))
|
68
62
|
end
|
69
63
|
|
70
64
|
def calculate_delay(headers, delivery_info)
|
@@ -14,9 +14,9 @@ module AdvancedSneakersActiveJob
|
|
14
14
|
|
15
15
|
private
|
16
16
|
|
17
|
-
def log_message
|
17
|
+
def log_message
|
18
18
|
logger.debug do
|
19
|
-
"Publishing <#{message}> to [#{
|
19
|
+
"Publishing <#{message}> to [#{@exchange_name}] with routing_key [#{message_options[:routing_key]}]"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -16,7 +16,7 @@ namespace :sneakers do
|
|
16
16
|
|
17
17
|
Sneakers.configure(AdvancedSneakersActiveJob.config.sneakers)
|
18
18
|
|
19
|
-
Sneakers.logger.level =
|
19
|
+
Sneakers.logger.level = AdvancedSneakersActiveJob.config.log_level
|
20
20
|
|
21
21
|
Rake::Task['sneakers:run'].invoke
|
22
22
|
end
|
@@ -25,8 +25,13 @@ ActiveSupport.on_load(:active_job) do
|
|
25
25
|
ActiveJob::Base.include AdvancedSneakersActiveJob::ActiveJobPatch
|
26
26
|
end
|
27
27
|
|
28
|
+
# Enforce definition of ActionMailer consumers
|
28
29
|
ActiveSupport.on_load(:action_mailer) do
|
29
|
-
|
30
|
+
# https://github.com/rails/rails/commit/f5050d998def98563f8fa4b381c09f563681f159
|
31
|
+
require 'action_mailer/mail_delivery_job' if ActionMailer.gem_version >= Gem::Version.new('6.0.0')
|
32
|
+
|
33
|
+
# https://github.com/rails/rails/commit/ddc7fb6e6ee957aae35f1bb11d35c2d3e3b0cdda
|
34
|
+
require 'action_mailer/delivery_job' if ActionMailer.gem_version < Gem::Version.new('7.0.0')
|
30
35
|
end
|
31
36
|
|
32
37
|
# Advanced Sneakers adapter for ActiveJob
|
@@ -54,11 +59,11 @@ module AdvancedSneakersActiveJob
|
|
54
59
|
end
|
55
60
|
|
56
61
|
def publisher
|
57
|
-
@publisher ||= AdvancedSneakersActiveJob::Publisher.new(config.publisher_config)
|
62
|
+
@publisher ||= AdvancedSneakersActiveJob::Publisher.new(**config.publisher_config)
|
58
63
|
end
|
59
64
|
|
60
65
|
def delayed_publisher
|
61
|
-
@delayed_publisher ||= AdvancedSneakersActiveJob::DelayedPublisher.new(config.publisher_config)
|
66
|
+
@delayed_publisher ||= AdvancedSneakersActiveJob::DelayedPublisher.new(**config.publisher_config)
|
62
67
|
end
|
63
68
|
|
64
69
|
# Based on ActiveSupport::Inflector#parameterize
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: advanced-sneakers-activejob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Sharshenov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activejob
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 0.2.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 0.2.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: sneakers
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,21 +54,21 @@ dependencies:
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '2.7'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: appraisal
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 2.3.0
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 2.3.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: bundler
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
@@ -82,61 +82,47 @@ dependencies:
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - "~>"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '1.13'
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '1.13'
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: rails
|
85
|
+
name: pry-byebug
|
100
86
|
requirement: !ruby/object:Gem::Requirement
|
101
87
|
requirements:
|
102
88
|
- - ">="
|
103
89
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
90
|
+
version: '0'
|
105
91
|
type: :development
|
106
92
|
prerelease: false
|
107
93
|
version_requirements: !ruby/object:Gem::Requirement
|
108
94
|
requirements:
|
109
95
|
- - ">="
|
110
96
|
- !ruby/object:Gem::Version
|
111
|
-
version: '
|
97
|
+
version: '0'
|
112
98
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
99
|
+
name: rabbitmq_http_api_client
|
114
100
|
requirement: !ruby/object:Gem::Requirement
|
115
101
|
requirements:
|
116
|
-
- - "
|
102
|
+
- - "~>"
|
117
103
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
104
|
+
version: '1.13'
|
119
105
|
type: :development
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
108
|
requirements:
|
123
|
-
- - "
|
109
|
+
- - "~>"
|
124
110
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
111
|
+
version: '1.13'
|
126
112
|
- !ruby/object:Gem::Dependency
|
127
113
|
name: rspec
|
128
114
|
requirement: !ruby/object:Gem::Requirement
|
129
115
|
requirements:
|
130
|
-
- - "
|
116
|
+
- - "~>"
|
131
117
|
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
118
|
+
version: '3.0'
|
133
119
|
type: :development
|
134
120
|
prerelease: false
|
135
121
|
version_requirements: !ruby/object:Gem::Requirement
|
136
122
|
requirements:
|
137
|
-
- - "
|
123
|
+
- - "~>"
|
138
124
|
- !ruby/object:Gem::Version
|
139
|
-
version: '0'
|
125
|
+
version: '3.0'
|
140
126
|
description: Advanced Sneakers adapter for ActiveJob
|
141
127
|
email:
|
142
128
|
- rustam@sharshenov.com
|
@@ -145,16 +131,9 @@ executables: []
|
|
145
131
|
extensions: []
|
146
132
|
extra_rdoc_files: []
|
147
133
|
files:
|
148
|
-
- ".gitignore"
|
149
|
-
- ".rspec"
|
150
|
-
- ".rubocop.yml"
|
151
|
-
- ".travis.yml"
|
152
134
|
- CHANGELOG.md
|
153
|
-
- Gemfile
|
154
135
|
- LICENSE.txt
|
155
136
|
- README.md
|
156
|
-
- Rakefile
|
157
|
-
- advanced-sneakers-activejob.gemspec
|
158
137
|
- lib/active_job/queue_adapters/advanced_sneakers_adapter.rb
|
159
138
|
- lib/advanced/sneakers/activejob.rb
|
160
139
|
- lib/advanced_sneakers_activejob.rb
|
@@ -177,7 +156,7 @@ licenses:
|
|
177
156
|
metadata:
|
178
157
|
homepage_uri: https://github.com/veeqo/advanced-sneakers-activejob
|
179
158
|
source_code_uri: https://github.com/veeqo/advanced-sneakers-activejob
|
180
|
-
changelog_uri: https://github.com/veeqo/advanced-sneakers-activejob/blob/
|
159
|
+
changelog_uri: https://github.com/veeqo/advanced-sneakers-activejob/blob/main/CHANGELOG.md
|
181
160
|
post_install_message:
|
182
161
|
rdoc_options: []
|
183
162
|
require_paths:
|
@@ -186,14 +165,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
165
|
requirements:
|
187
166
|
- - ">="
|
188
167
|
- !ruby/object:Gem::Version
|
189
|
-
version: '
|
168
|
+
version: '2.5'
|
190
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
170
|
requirements:
|
192
171
|
- - ">="
|
193
172
|
- !ruby/object:Gem::Version
|
194
173
|
version: '0'
|
195
174
|
requirements: []
|
196
|
-
rubygems_version: 3.0.
|
175
|
+
rubygems_version: 3.0.8
|
197
176
|
signing_key:
|
198
177
|
specification_version: 4
|
199
178
|
summary: Advanced Sneakers adapter for ActiveJob
|
data/.gitignore
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/_yardoc/
|
4
|
-
/coverage/
|
5
|
-
/doc/
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/tmp/
|
9
|
-
/Gemfile.lock
|
10
|
-
/.ruby-gemset
|
11
|
-
/.ruby-version
|
12
|
-
|
13
|
-
# rspec failure tracking
|
14
|
-
.rspec_status
|
15
|
-
|
16
|
-
# sneakers pid file
|
17
|
-
sneakers.pid
|
18
|
-
|
19
|
-
# log files
|
20
|
-
spec/apps/log/*
|
21
|
-
|
22
|
-
# temp files
|
23
|
-
spec/apps/tmp/*
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
NewCops: enable
|
3
|
-
|
4
|
-
Layout/LineLength:
|
5
|
-
Max: 140
|
6
|
-
Exclude:
|
7
|
-
- spec/**/*
|
8
|
-
|
9
|
-
Lint/SuppressedException:
|
10
|
-
Exclude:
|
11
|
-
- spec/**/*
|
12
|
-
|
13
|
-
Metrics/ClassLength:
|
14
|
-
Enabled: false
|
15
|
-
|
16
|
-
Metrics/BlockLength:
|
17
|
-
Exclude:
|
18
|
-
- advanced-sneakers-activejob.gemspec
|
19
|
-
- spec/**/*
|
20
|
-
|
21
|
-
Metrics/CyclomaticComplexity:
|
22
|
-
Exclude:
|
23
|
-
- spec/support/log_helpers.rb
|
24
|
-
|
25
|
-
Metrics/MethodLength:
|
26
|
-
Exclude:
|
27
|
-
- spec/**/*
|
28
|
-
|
29
|
-
Security/MarshalLoad:
|
30
|
-
Exclude:
|
31
|
-
- spec/**/*
|
32
|
-
|
33
|
-
Security/Eval:
|
34
|
-
Exclude:
|
35
|
-
- spec/apps/**/*
|
36
|
-
|
37
|
-
Metrics/AbcSize:
|
38
|
-
Exclude:
|
39
|
-
- spec/**/*
|
40
|
-
|
41
|
-
Style/Documentation:
|
42
|
-
Enabled: false
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
---
|
2
|
-
dist: xenial
|
3
|
-
language: ruby
|
4
|
-
cache: bundler
|
5
|
-
rvm:
|
6
|
-
- 2.5.8
|
7
|
-
- 2.6.6
|
8
|
-
- 2.7.1
|
9
|
-
env:
|
10
|
-
- RAILS_VERSION="~> 4.2.11"
|
11
|
-
- RAILS_VERSION="~> 5.2.4"
|
12
|
-
- RAILS_VERSION="~> 6.0.2"
|
13
|
-
jobs:
|
14
|
-
exclude:
|
15
|
-
- rvm: 2.7.1
|
16
|
-
env: RAILS_VERSION="~> 4.2.11"
|
17
|
-
|
18
|
-
before_install: gem install bundler -v 1.17.3
|
19
|
-
before_script:
|
20
|
-
- ".ci/install_rabbitmq"
|
21
|
-
bundler_args: --jobs 3 --retry 3
|
data/Gemfile
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
|
-
|
7
|
-
# Specify your gem's dependencies in advanced-sneakers-activejob.gemspec
|
8
|
-
gemspec
|
9
|
-
|
10
|
-
gem 'rails', ENV.fetch('RAILS_VERSION', '~> 4.2.11')
|
11
|
-
gem 'sneakers', ENV.fetch('SNEAKERS_VERSION', '~> 2.11')
|
data/Rakefile
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'advanced_sneakers_activejob/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |spec|
|
8
|
-
spec.name = 'advanced-sneakers-activejob'
|
9
|
-
spec.version = AdvancedSneakersActiveJob::VERSION
|
10
|
-
spec.authors = ['Rustam Sharshenov', 'Vlad Bokov']
|
11
|
-
spec.email = ['rustam@sharshenov.com', 'vlad@lunatic.cat']
|
12
|
-
|
13
|
-
spec.summary = 'Advanced Sneakers adapter for ActiveJob'
|
14
|
-
spec.description = 'Advanced Sneakers adapter for ActiveJob'
|
15
|
-
spec.homepage = 'https://github.com/veeqo/advanced-sneakers-activejob'
|
16
|
-
spec.license = 'MIT'
|
17
|
-
|
18
|
-
if spec.respond_to?(:metadata)
|
19
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
-
spec.metadata['source_code_uri'] = spec.homepage
|
21
|
-
spec.metadata['changelog_uri'] = 'https://github.com/veeqo/advanced-sneakers-activejob/blob/master/CHANGELOG.md'
|
22
|
-
end
|
23
|
-
|
24
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|\.ci)/}) }
|
26
|
-
end
|
27
|
-
spec.require_paths = ['lib']
|
28
|
-
|
29
|
-
spec.add_dependency 'activejob', '>= 4.2'
|
30
|
-
spec.add_dependency 'bunny-publisher', '~> 0.1'
|
31
|
-
spec.add_dependency 'sneakers', '~> 2.7'
|
32
|
-
|
33
|
-
spec.add_development_dependency 'bundler'
|
34
|
-
spec.add_development_dependency 'pry-byebug'
|
35
|
-
spec.add_development_dependency 'rabbitmq_http_api_client', '~> 1.13'
|
36
|
-
spec.add_development_dependency 'rails', '>= 4.2'
|
37
|
-
spec.add_development_dependency 'rake'
|
38
|
-
spec.add_development_dependency 'rspec'
|
39
|
-
end
|