faktory_worker_ruby 2.1.1 → 2.2.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/.github/workflows/ci.yml +2 -2
- data/Changes.md +9 -0
- data/Gemfile.lock +40 -42
- data/faktory_worker_ruby.gemspec +2 -3
- data/lib/active_job/queue_adapters/faktory_adapter.rb +11 -0
- data/lib/faktory/job.rb +15 -3
- data/lib/faktory/middleware/chain.rb +1 -0
- data/lib/faktory/version.rb +1 -1
- metadata +7 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 61cfbc8aa05f1700b58f7ba4f9a5899c8c2f08a092e579d278543e4067bdf789
|
|
4
|
+
data.tar.gz: 6a1c3012207e5e9079333e37cefe6452a05fde915d920bf580b080795bef69bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4408d26363ee756e2f74688004d72b587528340289a1ccca05689fe671986e5311d45ac90266802d514ab3f690d3af80aec8e3b755019750e5e0c68eca0300f3
|
|
7
|
+
data.tar.gz: e02f8ea49cd856e0d1876b3e3e584d3e47b550c9fc54f812742921e352176c75b01f88e866318e2a69323844a0d5d9a80bba1a10af4c4c99d6bef5a231d5213a
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
strategy:
|
|
12
12
|
fail-fast: false
|
|
13
13
|
matrix:
|
|
14
|
-
ruby: ["
|
|
14
|
+
ruby: ["3.2", "3.3", "3.4"]
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
16
|
services:
|
|
17
17
|
faktory:
|
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
- 7419:7419
|
|
21
21
|
- 7420:7420
|
|
22
22
|
steps:
|
|
23
|
-
- uses: actions/checkout@
|
|
23
|
+
- uses: actions/checkout@v6
|
|
24
24
|
- uses: ruby/setup-ruby@v1
|
|
25
25
|
with:
|
|
26
26
|
bundler-cache: true
|
data/Changes.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
- Add support for Active Job's transaction and iteration adapter hooks [#92]
|
|
6
|
+
- Forward compatibility with connection_pool 3.x
|
|
7
|
+
|
|
8
|
+
## 2.1.2
|
|
9
|
+
|
|
10
|
+
- Fix race condition in `faktory_options`. [#523]
|
|
11
|
+
|
|
3
12
|
## 2.1.1
|
|
4
13
|
|
|
5
14
|
- Add new `Faktory::Client#queue_latency` API
|
data/Gemfile.lock
CHANGED
|
@@ -1,57 +1,56 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
faktory_worker_ruby (2.
|
|
5
|
-
connection_pool (
|
|
4
|
+
faktory_worker_ruby (2.2.0)
|
|
5
|
+
connection_pool (< 4)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activejob (8.
|
|
11
|
-
activesupport (= 8.
|
|
10
|
+
activejob (8.1.3)
|
|
11
|
+
activesupport (= 8.1.3)
|
|
12
12
|
globalid (>= 0.3.6)
|
|
13
|
-
activesupport (8.
|
|
13
|
+
activesupport (8.1.3)
|
|
14
14
|
base64
|
|
15
|
-
benchmark (>= 0.3)
|
|
16
15
|
bigdecimal
|
|
17
16
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
18
17
|
connection_pool (>= 2.2.5)
|
|
19
18
|
drb
|
|
20
19
|
i18n (>= 1.6, < 2)
|
|
20
|
+
json
|
|
21
21
|
logger (>= 1.4.2)
|
|
22
22
|
minitest (>= 5.1)
|
|
23
23
|
securerandom (>= 0.3)
|
|
24
24
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
25
25
|
uri (>= 0.13.1)
|
|
26
26
|
ast (2.4.3)
|
|
27
|
-
base64 (0.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
connection_pool (2.5.3)
|
|
27
|
+
base64 (0.3.0)
|
|
28
|
+
bigdecimal (4.0.1)
|
|
29
|
+
concurrent-ruby (1.3.6)
|
|
30
|
+
connection_pool (3.0.2)
|
|
32
31
|
docile (1.4.1)
|
|
33
|
-
drb (2.2.
|
|
34
|
-
globalid (1.
|
|
32
|
+
drb (2.2.3)
|
|
33
|
+
globalid (1.3.0)
|
|
35
34
|
activesupport (>= 6.1)
|
|
36
|
-
i18n (1.14.
|
|
35
|
+
i18n (1.14.8)
|
|
37
36
|
concurrent-ruby (~> 1.0)
|
|
38
|
-
json (2.
|
|
39
|
-
language_server-protocol (3.17.0.
|
|
37
|
+
json (2.19.3)
|
|
38
|
+
language_server-protocol (3.17.0.5)
|
|
40
39
|
lint_roller (1.1.0)
|
|
41
40
|
logger (1.7.0)
|
|
42
|
-
minitest (
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
minitest (6.0.2)
|
|
42
|
+
drb (~> 2.0)
|
|
43
|
+
prism (~> 1.5)
|
|
45
44
|
parallel (1.27.0)
|
|
46
|
-
parser (3.3.
|
|
45
|
+
parser (3.3.11.1)
|
|
47
46
|
ast (~> 2.4.1)
|
|
48
47
|
racc
|
|
49
|
-
prism (1.
|
|
48
|
+
prism (1.9.0)
|
|
50
49
|
racc (1.8.1)
|
|
51
50
|
rainbow (3.1.1)
|
|
52
|
-
rake (13.
|
|
53
|
-
regexp_parser (2.
|
|
54
|
-
rubocop (1.
|
|
51
|
+
rake (13.3.1)
|
|
52
|
+
regexp_parser (2.11.3)
|
|
53
|
+
rubocop (1.84.2)
|
|
55
54
|
json (~> 2.3)
|
|
56
55
|
language_server-protocol (~> 3.17.0.2)
|
|
57
56
|
lint_roller (~> 1.1.0)
|
|
@@ -59,54 +58,53 @@ GEM
|
|
|
59
58
|
parser (>= 3.3.0.2)
|
|
60
59
|
rainbow (>= 2.2.2, < 4.0)
|
|
61
60
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
62
|
-
rubocop-ast (>= 1.
|
|
61
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
63
62
|
ruby-progressbar (~> 1.7)
|
|
64
63
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
65
|
-
rubocop-ast (1.
|
|
64
|
+
rubocop-ast (1.49.1)
|
|
66
65
|
parser (>= 3.3.7.2)
|
|
67
|
-
prism (~> 1.
|
|
68
|
-
rubocop-performance (1.
|
|
66
|
+
prism (~> 1.7)
|
|
67
|
+
rubocop-performance (1.26.1)
|
|
69
68
|
lint_roller (~> 1.1)
|
|
70
69
|
rubocop (>= 1.75.0, < 2.0)
|
|
71
|
-
rubocop-ast (>= 1.
|
|
70
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
72
71
|
ruby-progressbar (1.13.0)
|
|
73
72
|
securerandom (0.4.1)
|
|
74
73
|
simplecov (0.22.0)
|
|
75
74
|
docile (~> 1.1)
|
|
76
75
|
simplecov-html (~> 0.11)
|
|
77
76
|
simplecov_json_formatter (~> 0.1)
|
|
78
|
-
simplecov-html (0.13.
|
|
77
|
+
simplecov-html (0.13.2)
|
|
79
78
|
simplecov_json_formatter (0.1.4)
|
|
80
|
-
standard (1.
|
|
79
|
+
standard (1.54.0)
|
|
81
80
|
language_server-protocol (~> 3.17.0.2)
|
|
82
81
|
lint_roller (~> 1.0)
|
|
83
|
-
rubocop (~> 1.
|
|
82
|
+
rubocop (~> 1.84.0)
|
|
84
83
|
standard-custom (~> 1.0.0)
|
|
85
84
|
standard-performance (~> 1.8)
|
|
86
85
|
standard-custom (1.0.2)
|
|
87
86
|
lint_roller (~> 1.0)
|
|
88
87
|
rubocop (~> 1.50)
|
|
89
|
-
standard-performance (1.
|
|
88
|
+
standard-performance (1.9.0)
|
|
90
89
|
lint_roller (~> 1.1)
|
|
91
|
-
rubocop-performance (~> 1.
|
|
90
|
+
rubocop-performance (~> 1.26.0)
|
|
92
91
|
tzinfo (2.0.6)
|
|
93
92
|
concurrent-ruby (~> 1.0)
|
|
94
|
-
unicode-display_width (3.
|
|
95
|
-
unicode-emoji (~> 4.
|
|
96
|
-
unicode-emoji (4.0
|
|
97
|
-
uri (1.
|
|
93
|
+
unicode-display_width (3.2.0)
|
|
94
|
+
unicode-emoji (~> 4.1)
|
|
95
|
+
unicode-emoji (4.2.0)
|
|
96
|
+
uri (1.1.1)
|
|
98
97
|
|
|
99
98
|
PLATFORMS
|
|
100
99
|
ruby
|
|
101
100
|
|
|
102
101
|
DEPENDENCIES
|
|
103
|
-
activejob
|
|
102
|
+
activejob (>= 7.0.0, >= 0)
|
|
104
103
|
faktory_worker_ruby!
|
|
105
|
-
minitest
|
|
106
|
-
minitest-hooks
|
|
104
|
+
minitest
|
|
107
105
|
rake
|
|
108
106
|
simplecov
|
|
109
107
|
standard
|
|
110
108
|
|
|
111
109
|
BUNDLED WITH
|
|
112
|
-
|
|
110
|
+
4.0.4
|
data/faktory_worker_ruby.gemspec
CHANGED
|
@@ -22,9 +22,8 @@ Gem::Specification.new do |gem|
|
|
|
22
22
|
"source_code_uri" => "https://github.com/contribsys/faktory_worker_ruby"
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
gem.add_dependency "connection_pool", "
|
|
25
|
+
gem.add_dependency "connection_pool", "<4"
|
|
26
26
|
gem.add_development_dependency "activejob", ">= 7.0.0"
|
|
27
|
-
gem.add_development_dependency "minitest"
|
|
28
|
-
gem.add_development_dependency "minitest-hooks"
|
|
27
|
+
gem.add_development_dependency "minitest"
|
|
29
28
|
gem.add_development_dependency "rake"
|
|
30
29
|
end
|
|
@@ -10,6 +10,17 @@ module ActiveJob
|
|
|
10
10
|
#
|
|
11
11
|
# Rails.application.config.active_job.queue_adapter = :faktory
|
|
12
12
|
class FaktoryAdapter
|
|
13
|
+
@@stopping = false
|
|
14
|
+
Faktory.configure_worker { |config| config.on(:quiet) { @@stopping = true } }
|
|
15
|
+
|
|
16
|
+
def stopping?
|
|
17
|
+
@@stopping
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def enqueue_after_transaction_commit?(job) # :nodoc:
|
|
21
|
+
true
|
|
22
|
+
end
|
|
23
|
+
|
|
13
24
|
def enqueue(job) # :nodoc:
|
|
14
25
|
enqueue_at(job, nil)
|
|
15
26
|
end
|
data/lib/faktory/job.rb
CHANGED
|
@@ -122,6 +122,8 @@ module Faktory
|
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
module ClassMethods
|
|
125
|
+
ACCESSOR_MUTEX = Mutex.new
|
|
126
|
+
|
|
125
127
|
def set(options)
|
|
126
128
|
opts = get_faktory_options.dup
|
|
127
129
|
opts["jobtype"] = self
|
|
@@ -162,10 +164,18 @@ module Faktory
|
|
|
162
164
|
instance_writer = true
|
|
163
165
|
|
|
164
166
|
attrs.each do |name|
|
|
167
|
+
synchronized_getter = "__synchronized_#{name}"
|
|
168
|
+
|
|
165
169
|
singleton_class.instance_eval do
|
|
166
170
|
undef_method(name) if method_defined?(name) || private_method_defined?(name)
|
|
167
171
|
end
|
|
168
|
-
|
|
172
|
+
|
|
173
|
+
define_singleton_method(synchronized_getter) { nil }
|
|
174
|
+
singleton_class.class_eval do
|
|
175
|
+
private(synchronized_getter)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
define_singleton_method(name) { ACCESSOR_MUTEX.synchronize { send synchronized_getter } }
|
|
169
179
|
|
|
170
180
|
ivar = "@#{name}"
|
|
171
181
|
|
|
@@ -175,8 +185,10 @@ module Faktory
|
|
|
175
185
|
end
|
|
176
186
|
define_singleton_method(:"#{name}=") do |val|
|
|
177
187
|
singleton_class.class_eval do
|
|
178
|
-
|
|
179
|
-
|
|
188
|
+
ACCESSOR_MUTEX.synchronize do
|
|
189
|
+
undef_method(synchronized_getter) if method_defined?(synchronized_getter) || private_method_defined?(synchronized_getter)
|
|
190
|
+
define_method(synchronized_getter) { val }
|
|
191
|
+
end
|
|
180
192
|
end
|
|
181
193
|
|
|
182
194
|
if singleton_class?
|
data/lib/faktory/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: faktory_worker_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Perham
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: connection_pool
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - "<"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '4'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
|
-
- - "
|
|
23
|
+
- - "<"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '4'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: activejob
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -39,20 +39,6 @@ dependencies:
|
|
|
39
39
|
version: 7.0.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: minitest
|
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
|
43
|
-
requirements:
|
|
44
|
-
- - "~>"
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: '5'
|
|
47
|
-
type: :development
|
|
48
|
-
prerelease: false
|
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
-
requirements:
|
|
51
|
-
- - "~>"
|
|
52
|
-
- !ruby/object:Gem::Version
|
|
53
|
-
version: '5'
|
|
54
|
-
- !ruby/object:Gem::Dependency
|
|
55
|
-
name: minitest-hooks
|
|
56
42
|
requirement: !ruby/object:Gem::Requirement
|
|
57
43
|
requirements:
|
|
58
44
|
- - ">="
|
|
@@ -146,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
146
132
|
- !ruby/object:Gem::Version
|
|
147
133
|
version: '0'
|
|
148
134
|
requirements: []
|
|
149
|
-
rubygems_version:
|
|
135
|
+
rubygems_version: 4.0.6
|
|
150
136
|
specification_version: 4
|
|
151
137
|
summary: Ruby worker for Faktory
|
|
152
138
|
test_files: []
|