sidekiq_publisher 0.3.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +53 -0
- data/CHANGELOG.md +3 -0
- data/README.md +25 -1
- data/gemfiles/rails_5.1.gemfile +1 -1
- data/gemfiles/rails_5.2.gemfile +1 -1
- data/lib/sidekiq_publisher/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ae08c0bff2317e539eaaaf8b44f465f79367f1a479f4f1248f8b7571aef60fb
|
4
|
+
data.tar.gz: ec7d8c0bc03a976b3347efd70ebc894e0c8a619b0159ec3bef3791c8b47c1117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb9d1218bf709f5fbbcce6a687ad6ff6ae53cefaa6ecfecf2536b55c6af3cd618e216ac5207fb6ff1d935b375001350702f0745c60bea4cf1302fdcd2f9a4435
|
7
|
+
data.tar.gz: 32c95c4dd3e25f524649cb6508950afac248254bd847405219c6d53ed4d3de49fb4b5da5a8dc0c6accf9b7fd94b93de1adba4a42392022d422d14457c518ca87
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
version: "2"
|
2
|
+
checks:
|
3
|
+
file-lines:
|
4
|
+
enabled: false
|
5
|
+
method-lines:
|
6
|
+
enabled: false
|
7
|
+
plugins:
|
8
|
+
csslint:
|
9
|
+
enabled: true
|
10
|
+
duplication:
|
11
|
+
enabled: true
|
12
|
+
config:
|
13
|
+
languages:
|
14
|
+
- ruby
|
15
|
+
- javascript
|
16
|
+
fixme:
|
17
|
+
enabled: true
|
18
|
+
exclude_patterns:
|
19
|
+
- config/
|
20
|
+
- db/
|
21
|
+
- script/
|
22
|
+
- spec/
|
23
|
+
- vendor/
|
24
|
+
- "**.jpg"
|
25
|
+
- "**.png"
|
26
|
+
- "**.gif"
|
27
|
+
- "**.svg"
|
28
|
+
- "**.scss"
|
29
|
+
- "**.md"
|
30
|
+
- ".rubocop.yml"
|
31
|
+
- "Dockerfile"
|
32
|
+
- "Capfile"
|
33
|
+
- "README.md"
|
34
|
+
- "**.erb"
|
35
|
+
- "**.jbuilder"
|
36
|
+
- "**.rabl"
|
37
|
+
- "**.zip"
|
38
|
+
- "**.crt"
|
39
|
+
- "**.txt"
|
40
|
+
- "**.ico"
|
41
|
+
- "**.eot"
|
42
|
+
- "**.pdf"
|
43
|
+
- "**.html"
|
44
|
+
- "**.key"
|
45
|
+
- "**.docx"
|
46
|
+
- "**.fcgi"
|
47
|
+
- "**.xml"
|
48
|
+
- "**.pem"
|
49
|
+
- "**.csr"
|
50
|
+
- "**.org"
|
51
|
+
- "**.cgi"
|
52
|
+
- "**.ru"
|
53
|
+
- "**.pptx"
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -103,6 +103,31 @@ To use the `SidekiqPublisher`, this can be replaced by including
|
|
103
103
|
`SidekiqPublisher::Worker`. The usual `perform_async`, etc methods will be
|
104
104
|
available on the class but jobs will be staged in the Postgres table.
|
105
105
|
|
106
|
+
### Tying to a transaction
|
107
|
+
To guarantee that your job is enqueued when there's a change to the
|
108
|
+
system of record, simply publish it during the transaction
|
109
|
+
representing that change. Usually, that can be accomplished by
|
110
|
+
publishing in one of the ActiveRecord callbacks that are called
|
111
|
+
within-transaction (e.g. `after_save`, but not `after_commit` and its
|
112
|
+
derivatives):
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
class Frob < ApplicationRecord
|
116
|
+
after_save do
|
117
|
+
MyJob.perform_later id
|
118
|
+
end
|
119
|
+
end
|
120
|
+
```
|
121
|
+
|
122
|
+
For considering more complicated situations (e.g. jobs that should be
|
123
|
+
guaranteed during specific changes across models), the rails guides on
|
124
|
+
[querying](https://guides.rubyonrails.org/active_record_querying.html)
|
125
|
+
and
|
126
|
+
[callbacks](https://guides.rubyonrails.org/active_record_callbacks.html),
|
127
|
+
and the documentation on
|
128
|
+
[transactions](https://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html)
|
129
|
+
in ActiveRecord are good resources to consult.
|
130
|
+
|
106
131
|
### Running
|
107
132
|
|
108
133
|
The publisher process that pulls the job data from Postgres and puts them into Redis
|
@@ -134,4 +159,3 @@ https://github.com/ezcater/sidekiq_publisher.
|
|
134
159
|
|
135
160
|
The gem is available as open source under the terms of the
|
136
161
|
[MIT License](http://opensource.org/licenses/MIT).
|
137
|
-
|
data/gemfiles/rails_5.1.gemfile
CHANGED
data/gemfiles/rails_5.2.gemfile
CHANGED
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: 1.0.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:
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -275,6 +275,7 @@ executables: []
|
|
275
275
|
extensions: []
|
276
276
|
extra_rdoc_files: []
|
277
277
|
files:
|
278
|
+
- ".codeclimate.yml"
|
278
279
|
- Appraisals
|
279
280
|
- CHANGELOG.md
|
280
281
|
- Gemfile
|
@@ -317,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
318
|
version: '0'
|
318
319
|
requirements: []
|
319
320
|
rubyforge_project:
|
320
|
-
rubygems_version: 2.7.
|
321
|
+
rubygems_version: 2.7.9
|
321
322
|
signing_key:
|
322
323
|
specification_version: 4
|
323
324
|
summary: Publisher for enqueuing jobs to Sidekiq
|