Module: Kino

Defined in:
lib/kino.rb,
lib/kino/cli.rb,
lib/kino/check.rb,
lib/kino/input.rb,
lib/kino/logger.rb,
lib/kino/server.rb,
lib/kino/stream.rb,
lib/kino/worker.rb,
lib/kino/version.rb,
lib/kino/null_input.rb,
lib/kino/configuration.rb,
lib/kino/errors_stream.rb,
lib/kino/ractor_supervisor.rb

Overview

A high-performance Ractor web server for Ruby 4.0+: Rack 3-based, with a Rust (tokio + hyper) front-end and Ractor-parallel Ruby workers, plus a threaded fallback mode for apps (such as Rails) that are not Ractor-shareable.

The public API is Server, Configuration, Check, Logger, and Kino.sleep; the kino executable is implemented by CLI.

Defined Under Namespace

Modules: CLI, Check Classes: Configuration, Error, Logger, Server, UnshareableAppError

Constant Summary collapse

VERSION =

The gem version (single source of truth; ext/kino/Cargo.toml syncs).

"0.1.2"

Class Method Summary collapse

Class Method Details

.sleep(seconds) ⇒ nil

High-resolution sleep that bypasses the VM timer (whose wakeups inside non-main ractors are coarse: ~+2.5ms on Linux). Sleeps on the OS clock with the GVL released; chunked so Thread#kill and shutdown interrupts are honored between chunks.

Parameters:

  • seconds (Numeric)

    how long to sleep; must be non-negative

Returns:

  • (nil)

Raises:

  • (ArgumentError)

    for negative or non-numeric durations



29
30
31
32
33
34
35
# File 'lib/kino.rb', line 29

def self.sleep(seconds)
  remaining = Float(seconds)
  raise ArgumentError, "sleep duration must be non-negative" if remaining.negative?

  remaining = Native.sleep_chunk(remaining) while remaining.positive?
  nil
end