zizq 0.3.2 → 0.3.4
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/README.md +2 -2
- data/lib/zizq/configuration.rb +27 -1
- data/lib/zizq/enqueue_request.rb +2 -2
- data/lib/zizq/version.rb +1 -1
- data/sig/generated/zizq/configuration.rbs +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99a09e939c3261e843c176cd936a29e4e6f6a725ac802d93273a2608692b9616
|
|
4
|
+
data.tar.gz: ef6a5a3af87980b71a68a10a16969c29f572ef55d4b628de89bde210f0949f69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4eae14c105f51ca5d3b8f8fbf51e635bee289d81a2d81603ba47ee85c29493daa67eee2d3fa07246ba91a2d98381f9e2f7db46ad23e13d191228df9c48043fd7
|
|
7
|
+
data.tar.gz: 78382c2d8062b3b51a76fd44760b9116fe71b5f273b5d3ec8d458e6e8609fd6d8a22f5f54717920dc6197393f5ba56e05298ccf51fd5a5beefc1d52ee838a65d
|
data/README.md
CHANGED
|
@@ -32,13 +32,13 @@ API.
|
|
|
32
32
|
Add it to your application's `Gemfile`:
|
|
33
33
|
|
|
34
34
|
```ruby
|
|
35
|
-
gem 'zizq', '~> 0.3.
|
|
35
|
+
gem 'zizq', '~> 0.3.4'
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
Or install it manually:
|
|
39
39
|
|
|
40
40
|
```shell
|
|
41
|
-
$ gem install zizq -v 0.3.
|
|
41
|
+
$ gem install zizq -v 0.3.4
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Ruby **3.2.8 or newer** is required. Client and server share version
|
data/lib/zizq/configuration.rb
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# rbs_inline: enabled
|
|
5
5
|
# frozen_string_literal: true
|
|
6
6
|
|
|
7
|
+
require "delegate"
|
|
7
8
|
require "logger"
|
|
8
9
|
require "openssl"
|
|
9
10
|
|
|
@@ -61,7 +62,7 @@ module Zizq
|
|
|
61
62
|
def initialize #: () -> void
|
|
62
63
|
@url = "http://localhost:7890"
|
|
63
64
|
@format = :msgpack
|
|
64
|
-
@logger = Logger.new($stdout, level: Logger::INFO)
|
|
65
|
+
@logger = Logger.new(FlushingIO.new($stdout), level: Logger::INFO)
|
|
65
66
|
@tls = nil
|
|
66
67
|
@worker = nil
|
|
67
68
|
@read_timeout = 30
|
|
@@ -214,6 +215,31 @@ module Zizq
|
|
|
214
215
|
end
|
|
215
216
|
end
|
|
216
217
|
|
|
218
|
+
# @private
|
|
219
|
+
# IO delegator that flushes the underlying IO after every write.
|
|
220
|
+
# We wrap `$stdout` in this for the default logger so log lines
|
|
221
|
+
# appear immediately when stdout is connected to a pipe (foreman,
|
|
222
|
+
# systemd, k8s). Without it, the C-stdio default switches from
|
|
223
|
+
# line-buffered to fully-buffered for pipes and log output piles
|
|
224
|
+
# up in a 4–8KB buffer until the process exits.
|
|
225
|
+
#
|
|
226
|
+
# The wrapper is local to the default logger — apps supplying
|
|
227
|
+
# their own `c.logger = ...` retain full control over flushing.
|
|
228
|
+
class FlushingIO < SimpleDelegator
|
|
229
|
+
def write(*args) #: (*untyped) -> Integer
|
|
230
|
+
result = super
|
|
231
|
+
__getobj__.flush
|
|
232
|
+
result
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Declared explicitly so the type checker sees us satisfying
|
|
236
|
+
# `Logger::_WriteCloser`; SimpleDelegator forwards `close` via
|
|
237
|
+
# `method_missing`, but Steep doesn't follow that.
|
|
238
|
+
def close #: () -> void
|
|
239
|
+
__getobj__.close
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
217
243
|
private
|
|
218
244
|
|
|
219
245
|
def validate_tls!(tls) #: (TlsConfiguration) -> void
|
data/lib/zizq/enqueue_request.rb
CHANGED
|
@@ -157,8 +157,8 @@ module Zizq
|
|
|
157
157
|
if backoff
|
|
158
158
|
params[:backoff] = {
|
|
159
159
|
exponent: backoff[:exponent].to_f,
|
|
160
|
-
base_ms: (backoff[:base].to_f * 1000).
|
|
161
|
-
jitter_ms: (backoff[:jitter].to_f * 1000).
|
|
160
|
+
base_ms: (backoff[:base].to_f * 1000).to_i,
|
|
161
|
+
jitter_ms: (backoff[:jitter].to_f * 1000).to_i
|
|
162
162
|
}
|
|
163
163
|
end
|
|
164
164
|
|
data/lib/zizq/version.rb
CHANGED
|
@@ -121,6 +121,25 @@ module Zizq
|
|
|
121
121
|
def call: (untyped arg) -> untyped
|
|
122
122
|
end
|
|
123
123
|
|
|
124
|
+
# @private
|
|
125
|
+
# IO delegator that flushes the underlying IO after every write.
|
|
126
|
+
# We wrap `$stdout` in this for the default logger so log lines
|
|
127
|
+
# appear immediately when stdout is connected to a pipe (foreman,
|
|
128
|
+
# systemd, k8s). Without it, the C-stdio default switches from
|
|
129
|
+
# line-buffered to fully-buffered for pipes and log output piles
|
|
130
|
+
# up in a 4–8KB buffer until the process exits.
|
|
131
|
+
#
|
|
132
|
+
# The wrapper is local to the default logger — apps supplying
|
|
133
|
+
# their own `c.logger = ...` retain full control over flushing.
|
|
134
|
+
class FlushingIO < SimpleDelegator
|
|
135
|
+
def write: (*untyped args) -> untyped
|
|
136
|
+
|
|
137
|
+
# Declared explicitly so the type checker sees us satisfying
|
|
138
|
+
# `Logger::_WriteCloser`; SimpleDelegator forwards `close` via
|
|
139
|
+
# `method_missing`, but Steep doesn't follow that.
|
|
140
|
+
def close: () -> untyped
|
|
141
|
+
end
|
|
142
|
+
|
|
124
143
|
private
|
|
125
144
|
|
|
126
145
|
def validate_tls!: (untyped tls) -> untyped
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zizq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Corbyn <chris@zizq.io>
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async-http
|