faktory_worker_ruby 2.1.0 → 2.1.1
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/Changes.md +6 -0
- data/README.md +3 -3
- data/lib/faktory/client.rb +10 -1
- data/lib/faktory/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8df3ceda59c66e2bcb7d04f70fec7de89e6a6219f9159420a9500df7c8a0d35b
|
4
|
+
data.tar.gz: 258295f65b955167b9d89f66aada3b28675368d835362edef694bd50b10f57cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b02206889ca2ff8b57f3de485a880904b9eb8e422975e78ed23176e753b4cc5ce7d4eca76f65f7f9b0c49c0440503892e26cdc9f960d170a076f8d49570a4d1
|
7
|
+
data.tar.gz: 7e7065afe15d6308245131ab4524fd5d2accdf51590817c91cd83beededd356a3bc4e0132cfc42f1eeb2bfc13bb367eecf8087f6c225d4a939d2f05828709662
|
data/Changes.md
CHANGED
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/version.rb
CHANGED