kino 0.1.0
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 +7 -0
- data/.yardopts +14 -0
- data/CHANGELOG.md +54 -0
- data/Cargo.lock +993 -0
- data/Cargo.toml +15 -0
- data/LICENSE.txt +21 -0
- data/README.md +384 -0
- data/doc/README.md +6 -0
- data/doc/architecture.md +161 -0
- data/doc/benchmarks.md +321 -0
- data/doc/rails-on-ractors.md +50 -0
- data/doc/why-kino.md +91 -0
- data/exe/kino +26 -0
- data/ext/kino/Cargo.toml +49 -0
- data/ext/kino/build.rs +5 -0
- data/ext/kino/extconf.rb +6 -0
- data/ext/kino/src/env_strings.rs +318 -0
- data/ext/kino/src/gvl.rs +103 -0
- data/ext/kino/src/lib.rs +90 -0
- data/ext/kino/src/logsink.rs +155 -0
- data/ext/kino/src/queue.rs +207 -0
- data/ext/kino/src/registry.rs +268 -0
- data/ext/kino/src/request.rs +432 -0
- data/ext/kino/src/response.rs +214 -0
- data/ext/kino/src/server.rs +621 -0
- data/ext/kino/src/style.rs +87 -0
- data/ext/kino/src/test_support.rs +82 -0
- data/ext/kino/src/timer.rs +57 -0
- data/ext/kino/src/tls.rs +96 -0
- data/lib/kino/check.rb +199 -0
- data/lib/kino/cli.rb +254 -0
- data/lib/kino/configuration.rb +190 -0
- data/lib/kino/errors_stream.rb +25 -0
- data/lib/kino/input.rb +77 -0
- data/lib/kino/logger.rb +56 -0
- data/lib/kino/null_input.rb +37 -0
- data/lib/kino/ractor_supervisor.rb +103 -0
- data/lib/kino/server.rb +271 -0
- data/lib/kino/stream.rb +61 -0
- data/lib/kino/templates/kino.rb.tt +141 -0
- data/lib/kino/version.rb +6 -0
- data/lib/kino/worker.rb +124 -0
- data/lib/kino.rb +53 -0
- data/sig/kino.rbs +178 -0
- metadata +219 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: a4e73026c9f3087a58234e0f8fc88be1e407bb7435e8e8a0be43d087f318bcad
|
|
4
|
+
data.tar.gz: 49581091f865d3ff11227900376ad9499d1bddef77a4b3b0bc5b3b7405d58bd8
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3e420380536f5c73a417d20945ad49f7f0a8e46d3cec5feabfde50600aab9dfc18b2e16d64656b2e1529e5e2c08384efabf4be9f36bebfb9cc737a245e348aec
|
|
7
|
+
data.tar.gz: f0e38db0ea8bb93cfa7825db47ebcf72319e76ac82487ed6efb191d82db86a8c205899f7996f34976b36d1960dd97f3086fa4a5359179ce8c7f35bfa5d8b94f4
|
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
## [0.1.0] - 2026-06-11
|
|
2
|
+
|
|
3
|
+
Initial release.
|
|
4
|
+
|
|
5
|
+
- HTTP/1.1 server with all network I/O in Rust on tokio + hyper.
|
|
6
|
+
- Worker **Ractors** for true parallel request handling (`mode: :ractor`,
|
|
7
|
+
requires a Ractor-shareable app), with a threaded fallback (`mode: :threaded`)
|
|
8
|
+
that runs any Rack app, Rails included. Puma-style `workers × threads`
|
|
9
|
+
topology in both modes.
|
|
10
|
+
- Rack 3 spec compliance verified by Rack::Lint over real sockets: streaming
|
|
11
|
+
request bodies (forward-only `rack.input`), enumerable and callable
|
|
12
|
+
(full-duplex stream) response bodies, lowercase/multi-value headers.
|
|
13
|
+
- Supervised crash recovery: a dying ractor 500s its in-flight requests
|
|
14
|
+
immediately and is respawned.
|
|
15
|
+
- Graceful shutdown: drain to deadline, then abort in-flight clients and
|
|
16
|
+
reap workers; second signal force-exits.
|
|
17
|
+
- Bounded request queue with 503 backpressure; bounded body channels give
|
|
18
|
+
per-request backpressure in both directions with the GVL released.
|
|
19
|
+
- TLS via rustls (file paths or inline PEM).
|
|
20
|
+
- Near-zero-allocation env construction: frozen LRU caches for
|
|
21
|
+
Host/peer-address values, shared frozen `rack.errors`, and a shared
|
|
22
|
+
frozen null `rack.input` for bodyless requests.
|
|
23
|
+
- The Rust side allocates through mimalloc (chosen over jemalloc in a three-way benchmark).
|
|
24
|
+
- Fused worker loop: the env arrives with the request handle embedded
|
|
25
|
+
(`env["kino.request"]`) and the common complete-body response rides a
|
|
26
|
+
single respond-and-take native call—~one FFI crossing per request,
|
|
27
|
+
no per-request arrays. Opt-in `batch` directive for grabbing several
|
|
28
|
+
queued requests per visit (default 1; >1 trades fairness for
|
|
29
|
+
throughput).
|
|
30
|
+
- Experimental `lanes` mode: per-worker queues with awake-preferring
|
|
31
|
+
dispatch and work stealing (+20% ractor-mode plaintext on Linux,
|
|
32
|
+
making ractor the fastest Kino configuration on real hardware). Off
|
|
33
|
+
by default.
|
|
34
|
+
- Live stats: `server.stats` (queued, in-flight, served, rejected,
|
|
35
|
+
respawns, lane depths) and a `SIGUSR1` one-line dump for CLI servers.
|
|
36
|
+
- Native async logging: a `log_requests` access log (status-colored on
|
|
37
|
+
color terminals—2xx green, 3xx yellow, 4xx maroon, 5xx bright red—503
|
|
38
|
+
rejections included) and `Kino::Logger` / `Kino::Logger::Device`—lines
|
|
39
|
+
flow through a lock-free channel to a Rust flusher thread, so
|
|
40
|
+
request threads never take a log mutex or issue a write syscall. The
|
|
41
|
+
device is Ractor-shareable.
|
|
42
|
+
- `kino --check` (and `Kino::Check.report`): explains why an app is not
|
|
43
|
+
Ractor-shareable—captured variables with definition sites, ivar
|
|
44
|
+
paths, and the class-ivar trap—without freezing anything.
|
|
45
|
+
- Puma-style Ruby DSL config file (`kino.rb`) and a `kino` CLI
|
|
46
|
+
(`kino -C kino.rb config.ru`); precedence kwargs > file > defaults.
|
|
47
|
+
Directives include `environment`, `pidfile`, and `rackup`.
|
|
48
|
+
- Hot-path performance work: a GVL-free queue fast path, zero-copy response
|
|
49
|
+
headers, a frozen Ractor-shareable env-string cache, and no per-request
|
|
50
|
+
task spawns. Single-process throughput is on par with (or modestly above)
|
|
51
|
+
a same-topology process cluster in our benchmarks; see README.
|
|
52
|
+
- Request timeouts: `request_timeout: seconds` (off by default) returns an
|
|
53
|
+
immediate 504 when the app misses the deadline; the late response is
|
|
54
|
+
dropped and the handler is never killed. Counted as `stats[:timeouts]`.
|