Class: Zizq::Configuration::FlushingIO

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/zizq/configuration.rb,
sig/generated/zizq/configuration.rbs

Overview

IO delegator that flushes the underlying IO after every write. We wrap $stdout in this for the default logger so log lines appear immediately when stdout is connected to a pipe (foreman, systemd, k8s). Without it, the C-stdio default switches from line-buffered to fully-buffered for pipes and log output piles up in a 4–8KB buffer until the process exits.

The wrapper is local to the default logger — apps supplying their own c.logger = ... retain full control over flushing.

Instance Method Summary collapse

Instance Method Details

#closeObject

Declared explicitly so the type checker sees us satisfying Logger::_WriteCloser; SimpleDelegator forwards close via method_missing, but Steep doesn't follow that.

Returns:

  • (Object)


249
250
251
# File 'lib/zizq/configuration.rb', line 249

def close #: () -> void
  __getobj__.close
end

#write(*args) ⇒ Object

: (*untyped) -> Integer

Parameters:

  • args (Object)

Returns:

  • (Object)


240
241
242
243
244
# File 'lib/zizq/configuration.rb', line 240

def write(*args) #: (*untyped) -> Integer
  result = super
  __getobj__.flush
  result
end