faktory_worker_ruby 2.1.0 → 2.1.2
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 +10 -0
- data/Gemfile.lock +37 -38
- data/README.md +3 -3
- data/lib/faktory/client.rb +10 -1
- data/lib/faktory/job.rb +15 -3
- data/lib/faktory/middleware/chain.rb +1 -0
- data/lib/faktory/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5bc50e5880ae9251f03af00d572ba2f8ede535c8b32dc46a78f575b2b029d928
|
|
4
|
+
data.tar.gz: 4af492a8da94673d2be33ef8bbae0f6fedbe88586ffcd4fb3b0b1e1c259a179f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 920a1448f12e688036b9282e1e7e3971de3a0bd6db99a28b0f160a1e41bf86c79b4f579a3e5e2fe08d437a7a9f42bf3933cb683f9d011a673f4d06c2e97a2d91
|
|
7
|
+
data.tar.gz: dd0b203e37eace0dc4949b056932e2ba24b55502349bf29c4df584309833828d27206fb33bdcec7a73eb2cad4132a6e87926bc3bc992cd3a2a053bb7a97794bd
|
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,15 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2.1.2
|
|
4
|
+
|
|
5
|
+
- Fix race condition in `faktory_options`. [#523]
|
|
6
|
+
|
|
7
|
+
## 2.1.1
|
|
8
|
+
|
|
9
|
+
- Add new `Faktory::Client#queue_latency` API
|
|
10
|
+
- Require OpenSSL for client
|
|
11
|
+
- Bump requirements for Ruby, Rails
|
|
12
|
+
|
|
3
13
|
## 2.1.0
|
|
4
14
|
|
|
5
15
|
- Require ActiveJob 7.0+, connection_pool 2.5+
|
data/Gemfile.lock
CHANGED
|
@@ -1,57 +1,56 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
faktory_worker_ruby (2.1.
|
|
4
|
+
faktory_worker_ruby (2.1.2)
|
|
5
5
|
connection_pool (~> 2.5)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activejob (8.
|
|
11
|
-
activesupport (= 8.
|
|
10
|
+
activejob (8.1.2)
|
|
11
|
+
activesupport (= 8.1.2)
|
|
12
12
|
globalid (>= 0.3.6)
|
|
13
|
-
activesupport (8.
|
|
13
|
+
activesupport (8.1.2)
|
|
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 (2.5.5)
|
|
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.18.0)
|
|
38
|
+
language_server-protocol (3.17.0.5)
|
|
40
39
|
lint_roller (1.1.0)
|
|
41
40
|
logger (1.7.0)
|
|
42
|
-
minitest (5.
|
|
43
|
-
minitest-hooks (1.5.
|
|
41
|
+
minitest (5.27.0)
|
|
42
|
+
minitest-hooks (1.5.3)
|
|
44
43
|
minitest (> 5.3)
|
|
45
44
|
parallel (1.27.0)
|
|
46
|
-
parser (3.3.
|
|
45
|
+
parser (3.3.10.1)
|
|
47
46
|
ast (~> 2.4.1)
|
|
48
47
|
racc
|
|
49
|
-
prism (1.
|
|
48
|
+
prism (1.8.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.82.1)
|
|
55
54
|
json (~> 2.3)
|
|
56
55
|
language_server-protocol (~> 3.17.0.2)
|
|
57
56
|
lint_roller (~> 1.1.0)
|
|
@@ -59,48 +58,48 @@ 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.48.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.0)
|
|
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.53.0)
|
|
81
80
|
language_server-protocol (~> 3.17.0.2)
|
|
82
81
|
lint_roller (~> 1.0)
|
|
83
|
-
rubocop (~> 1.
|
|
82
|
+
rubocop (~> 1.82.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
104
|
minitest (~> 5)
|
|
106
105
|
minitest-hooks
|
|
@@ -109,4 +108,4 @@ DEPENDENCIES
|
|
|
109
108
|
standard
|
|
110
109
|
|
|
111
110
|
BUNDLED WITH
|
|
112
|
-
|
|
111
|
+
4.0.4
|
data/README.md
CHANGED
|
@@ -34,10 +34,10 @@ server part is [here](https://github.com/contribsys/faktory/)
|
|
|
34
34
|
|
|
35
35
|
## Requirements
|
|
36
36
|
|
|
37
|
-
* Ruby 2
|
|
38
|
-
* Faktory 1.
|
|
37
|
+
* Ruby 3.2 or higher
|
|
38
|
+
* Faktory 1.9 or higher [Installation](https://github.com/contribsys/faktory/wiki/Installation)
|
|
39
39
|
|
|
40
|
-
Optionally, Rails
|
|
40
|
+
Optionally, Rails 7.0+ for ActiveJob.
|
|
41
41
|
|
|
42
42
|
## Installation
|
|
43
43
|
|
data/lib/faktory/client.rb
CHANGED
|
@@ -5,6 +5,7 @@ require "cgi"
|
|
|
5
5
|
require "digest"
|
|
6
6
|
require "securerandom"
|
|
7
7
|
require "faktory/io"
|
|
8
|
+
require "openssl"
|
|
8
9
|
|
|
9
10
|
module Faktory
|
|
10
11
|
class BaseError < StandardError; end
|
|
@@ -158,6 +159,15 @@ module Faktory
|
|
|
158
159
|
end
|
|
159
160
|
end
|
|
160
161
|
|
|
162
|
+
def queue_latency(*queues)
|
|
163
|
+
qs = Array(queues)
|
|
164
|
+
raise ArgumentError, "no queue given" if qs.empty?
|
|
165
|
+
transaction do
|
|
166
|
+
command "QUEUE LATENCY", qs.join(" ")
|
|
167
|
+
JSON.parse(result!)
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
161
171
|
# Push a hash corresponding to a job payload to Faktory.
|
|
162
172
|
# Hash must contain "jid", "jobtype" and "args" elements at minimum.
|
|
163
173
|
# Returned value will either be the JID String if successful OR
|
|
@@ -251,7 +261,6 @@ module Faktory
|
|
|
251
261
|
def open_socket
|
|
252
262
|
tlserrors = []
|
|
253
263
|
if tls?
|
|
254
|
-
require "openssl"
|
|
255
264
|
tlserrors << ::OpenSSL::SSL::SSLError
|
|
256
265
|
sock = TCPSocket.new(@location.hostname, @location.port)
|
|
257
266
|
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
|
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,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: faktory_worker_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.2
|
|
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
|
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
146
146
|
- !ruby/object:Gem::Version
|
|
147
147
|
version: '0'
|
|
148
148
|
requirements: []
|
|
149
|
-
rubygems_version:
|
|
149
|
+
rubygems_version: 4.0.4
|
|
150
150
|
specification_version: 4
|
|
151
151
|
summary: Ruby worker for Faktory
|
|
152
152
|
test_files: []
|