sidekiq_publisher 0.2.1 → 0.3.0
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/Appraisals +11 -0
- data/CHANGELOG.md +3 -0
- data/README.md +17 -7
- data/gemfiles/rails_5.1.gemfile +8 -0
- data/gemfiles/rails_5.2.gemfile +8 -0
- data/lib/sidekiq_publisher/version.rb +1 -1
- data/sidekiq_publisher.gemspec +3 -2
- metadata +31 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78573ce69bf9d0df8956606ced8f7be7089eb998cd568c7d7675b1363dfa8425
|
|
4
|
+
data.tar.gz: c07a68f0b3ef57665b3adbe8335e29c760ddfb5f033864b4562392beafadbb8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c9c4f7873c593d05892b3999a8a4ec054f8f0a5f71c24d67e5c08295ed0328f5c07d943671df130d4f76dcde684b5526f4f3ecdc6ded3e9fcefbe16194d2cd6
|
|
7
|
+
data.tar.gz: 9a830c519b65182871cc287161a7be70012aaa60aed60fa488e3f30e410f4b8173b2da571dd2bd9467db2a52b597742ad010d5d4e57ab39cb8869adec785cac9
|
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -39,11 +39,10 @@ This gem uses the following configuration:
|
|
|
39
39
|
* **logger**: the logger for this gem to use.
|
|
40
40
|
* **exception_reporter**: a Proc that will be called with an exception
|
|
41
41
|
* **metrics_reporter**: an optional object to record metrics. See below.
|
|
42
|
-
* **batch_size**: the maximum number of jobs that will be enqueued to Sidekiq
|
|
43
|
-
together
|
|
42
|
+
* **batch_size**: the maximum number of jobs that will be enqueued together to Sidekiq
|
|
44
43
|
* **job_retention_period**: the duration that published jobs will be kept in
|
|
45
44
|
Postgres after they have been enqueued to Sidekiq
|
|
46
|
-
|
|
45
|
+
|
|
47
46
|
### Metrics Reporter
|
|
48
47
|
|
|
49
48
|
The metrics reporter that can be configured with an object that is expected to
|
|
@@ -85,6 +84,15 @@ config.active_job.queue_adapter = :sidekiq_publisher
|
|
|
85
84
|
Rails.application.config.active_job.queue_adapter = :sidekiq_publisher
|
|
86
85
|
```
|
|
87
86
|
|
|
87
|
+
To selectively roll out the `SidekiqPublisher`, the adapter can be overridden for
|
|
88
|
+
a specific job class:
|
|
89
|
+
|
|
90
|
+
```ruby
|
|
91
|
+
class MyJob < ApplicationJob
|
|
92
|
+
self.queue_adapter = :sidekiq_publisher
|
|
93
|
+
end
|
|
94
|
+
```
|
|
95
|
+
|
|
88
96
|
### SidekiqPublisher::Worker
|
|
89
97
|
|
|
90
98
|
Sidekiq workers are usually defined by including `Sidekiq::Worker` in a class.
|
|
@@ -95,8 +103,8 @@ available on the class but jobs will be staged in the Postgres table.
|
|
|
95
103
|
|
|
96
104
|
### Running
|
|
97
105
|
|
|
98
|
-
The publisher process that pulls the job data from
|
|
99
|
-
can be run with a rake task that is added via
|
|
106
|
+
The publisher process that pulls the job data from Postgres and puts them into Redis
|
|
107
|
+
can be run with a rake task that is added via Railtie for Rails applications:
|
|
100
108
|
|
|
101
109
|
```bash
|
|
102
110
|
bundle exec rake sidekiq_publisher:publish
|
|
@@ -108,7 +116,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then,
|
|
|
108
116
|
run `rake spec` to run the tests. You can also run `bin/console` for an
|
|
109
117
|
interactive prompt that will allow you to experiment.
|
|
110
118
|
|
|
111
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
119
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
112
120
|
|
|
113
121
|
To release a new version, update the version number in `version.rb`, and then
|
|
114
122
|
run `bundle exec rake release`, which will create a git tag for the version,
|
|
@@ -118,7 +126,9 @@ push git commits and tags, and push the `.gem` file to
|
|
|
118
126
|
## Contributing
|
|
119
127
|
|
|
120
128
|
Bug reports and pull requests are welcome on GitHub at
|
|
121
|
-
https://github.com/ezcater/sidekiq_publisher
|
|
129
|
+
https://github.com/ezcater/sidekiq_publisher.
|
|
130
|
+
|
|
131
|
+
## License
|
|
122
132
|
|
|
123
133
|
The gem is available as open source under the terms of the
|
|
124
134
|
[MIT License](http://opensource.org/licenses/MIT).
|
data/sidekiq_publisher.gemspec
CHANGED
|
@@ -42,10 +42,11 @@ Gem::Specification.new do |spec|
|
|
|
42
42
|
spec.require_paths = ["lib"]
|
|
43
43
|
|
|
44
44
|
spec.add_development_dependency "activejob"
|
|
45
|
+
spec.add_development_dependency "appraisal"
|
|
45
46
|
spec.add_development_dependency "bundler", "~> 1.12"
|
|
46
47
|
spec.add_development_dependency "database_cleaner"
|
|
47
48
|
spec.add_development_dependency "ezcater_matchers" # TODO: this is a private gem
|
|
48
|
-
spec.add_development_dependency "ezcater_rubocop", "0.52.
|
|
49
|
+
spec.add_development_dependency "ezcater_rubocop", "0.52.8"
|
|
49
50
|
spec.add_development_dependency "factory_bot"
|
|
50
51
|
spec.add_development_dependency "overcommit"
|
|
51
52
|
spec.add_development_dependency "rake", "~> 10.0"
|
|
@@ -56,7 +57,7 @@ Gem::Specification.new do |spec|
|
|
|
56
57
|
spec.add_development_dependency "simplecov"
|
|
57
58
|
|
|
58
59
|
spec.add_runtime_dependency "activerecord-postgres_pub_sub"
|
|
59
|
-
spec.add_runtime_dependency "activesupport", "
|
|
60
|
+
spec.add_runtime_dependency "activesupport", ">= 5.1", "< 5.3"
|
|
60
61
|
spec.add_runtime_dependency "private_attr"
|
|
61
62
|
spec.add_runtime_dependency "sidekiq", "~> 5.0.4"
|
|
62
63
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sidekiq_publisher
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ezCater, Inc
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-06-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activejob
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: appraisal
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: bundler
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -72,14 +86,14 @@ dependencies:
|
|
|
72
86
|
requirements:
|
|
73
87
|
- - '='
|
|
74
88
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 0.52.
|
|
89
|
+
version: 0.52.8
|
|
76
90
|
type: :development
|
|
77
91
|
prerelease: false
|
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
93
|
requirements:
|
|
80
94
|
- - '='
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 0.52.
|
|
96
|
+
version: 0.52.8
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
98
|
name: factory_bot
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -210,16 +224,22 @@ dependencies:
|
|
|
210
224
|
name: activesupport
|
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
|
212
226
|
requirements:
|
|
213
|
-
- - "
|
|
227
|
+
- - ">="
|
|
214
228
|
- !ruby/object:Gem::Version
|
|
215
|
-
version: 5.1
|
|
229
|
+
version: '5.1'
|
|
230
|
+
- - "<"
|
|
231
|
+
- !ruby/object:Gem::Version
|
|
232
|
+
version: '5.3'
|
|
216
233
|
type: :runtime
|
|
217
234
|
prerelease: false
|
|
218
235
|
version_requirements: !ruby/object:Gem::Requirement
|
|
219
236
|
requirements:
|
|
220
|
-
- - "
|
|
237
|
+
- - ">="
|
|
238
|
+
- !ruby/object:Gem::Version
|
|
239
|
+
version: '5.1'
|
|
240
|
+
- - "<"
|
|
221
241
|
- !ruby/object:Gem::Version
|
|
222
|
-
version: 5.
|
|
242
|
+
version: '5.3'
|
|
223
243
|
- !ruby/object:Gem::Dependency
|
|
224
244
|
name: private_attr
|
|
225
245
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -255,10 +275,13 @@ executables: []
|
|
|
255
275
|
extensions: []
|
|
256
276
|
extra_rdoc_files: []
|
|
257
277
|
files:
|
|
278
|
+
- Appraisals
|
|
258
279
|
- CHANGELOG.md
|
|
259
280
|
- Gemfile
|
|
260
281
|
- LICENSE.txt
|
|
261
282
|
- README.md
|
|
283
|
+
- gemfiles/rails_5.1.gemfile
|
|
284
|
+
- gemfiles/rails_5.2.gemfile
|
|
262
285
|
- lib/active_job/queue_adapters/sidekiq_publisher_adapter.rb
|
|
263
286
|
- lib/generators/sidekiq_publisher/install_generator.rb
|
|
264
287
|
- lib/generators/sidekiq_publisher/templates/create_sidekiq_publisher_jobs.rb
|