zizq 0.3.2 → 0.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f0af940d511a8e1aa6d89df8ca13e98733430827d5f3202bcf7434a94ee02da
4
- data.tar.gz: 9341d2815e344b3e4b8ca402185e3de01bd488cb5a3159f18e132d3c65cc18ca
3
+ metadata.gz: 4ab68c867c5342352c99cccc1c244215a12256c8957be422c38c1446fbcc317e
4
+ data.tar.gz: 58651399c191747b0e1fab0b0751e53de4eb415dcb0ae5845b76eb35590cb5eb
5
5
  SHA512:
6
- metadata.gz: a3e04dffd06a36db8ca940105675428390867bd8dee62b2bcf0ef7cbeef03fe080b35bf93061e9ec00b6834be0940e1d69d7bd837178718a0bd288b6895464c3
7
- data.tar.gz: 9d5a7d77ca3e143dbcc8c5bb72a58eb1c60092335d206579646dac8df3cbf178a9627a0d8e7a68e394d2b07c32a60a82c915ab049175624760a314042d12f9b7
6
+ metadata.gz: 4b35bd73a1e4c8c66113b7f1b0c4efbb1eef97e0b304730510a76a35498e6fcc38c15016b53b7507206e558535d07b1a0dbd377d7e5472247f9fffd5ac5a79ec
7
+ data.tar.gz: 6fbdbe994579189e68bd37e5ce4167a4c074593609cb7938f411e956c073b11d43c0863e8c8038bb2e77cfe0246263e3c7b55e83d3961f5da99e133164da766a
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.2'
35
+ gem 'zizq', '~> 0.3.3'
36
36
  ```
37
37
 
38
38
  Or install it manually:
39
39
 
40
40
  ```shell
41
- $ gem install zizq -v 0.3.2
41
+ $ gem install zizq -v 0.3.3
42
42
  ```
43
43
 
44
44
  Ruby **3.2.8 or newer** is required. Client and server share version
@@ -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/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  # frozen_string_literal: true
6
6
 
7
7
  module Zizq
8
- VERSION = "0.3.2" #: String
8
+ VERSION = "0.3.3" #: String
9
9
  end
@@ -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.2
4
+ version: 0.3.3
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-24 00:00:00.000000000 Z
11
+ date: 2026-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http