kino 0.2.0 → 0.3.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.
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kino
4
+ # @private
5
+ # The worker-context lifecycle hooks, bundled so one frozen, shareable
6
+ # value crosses into each worker (a ractor in :ractor mode) instead of
7
+ # several bare procs. Any member may be nil. A Data instance is frozen,
8
+ # so it is Ractor.shareable? exactly when its members are (nil, or a
9
+ # Ractor.shareable_proc), letting it ride the ractor boundary like the app.
10
+ WorkerHooks = Data.define(:on_error, :after_worker_boot, :after_request_complete)
11
+ end
data/lib/kino.rb CHANGED
@@ -43,8 +43,11 @@ require_relative "kino/null_input"
43
43
  require_relative "kino/errors_stream"
44
44
  require_relative "kino/stream"
45
45
  require_relative "kino/configuration"
46
+ require_relative "kino/hook_fire"
47
+ require_relative "kino/worker_hooks"
46
48
  require_relative "kino/worker"
47
49
  require_relative "kino/ractor_supervisor"
50
+ require_relative "kino/quarantine_monitor"
48
51
  require_relative "kino/server"
49
52
 
50
53
  # Hand the frozen shareable singletons to the native layer: it sets them
data/sig/kino.rbs CHANGED
@@ -22,6 +22,7 @@ module Kino
22
22
 
23
23
  class Server
24
24
  attr_reader port: Integer?
25
+ attr_reader control_port: Integer?
25
26
  attr_reader mode: Symbol
26
27
  attr_reader bind: String
27
28
 
@@ -98,11 +99,19 @@ module Kino
98
99
  def lanes: (boolish enabled) -> untyped
99
100
  def log_requests: (boolish enabled) -> untyped
100
101
  def on_error: (?^(Exception, Hash[String, untyped]) -> void handler) ?{ (Exception, Hash[String, untyped]) -> void } -> untyped
102
+ def after_boot: (?^() -> void handler) ?{ () -> void } -> untyped
103
+ def after_worker_boot: (?^(Integer) -> void handler) ?{ (Integer) -> void } -> untyped
104
+ def after_request_complete: (?^(Hash[String, untyped], Integer) -> void handler) ?{ (Hash[String, untyped], Integer) -> void } -> untyped
105
+ def on_worker_exit: (?^(Integer, Exception?) -> void handler) ?{ (Integer, Exception?) -> void } -> untyped
101
106
  def shutdown_timeout: (Numeric seconds) -> untyped
102
107
  def tokio_threads: (int count) -> untyped
103
108
  def tls: (cert: String, key: String) -> untyped
104
109
  def environment: (String | Symbol env) -> untyped
105
110
  def pidfile: (String path) -> untyped
111
+ def control_bind: (String addr) -> String
112
+ def control_token: (String token) -> String
113
+ def quarantine_timeout: (Numeric? seconds) -> untyped
114
+ def quarantine_max: (int count) -> untyped
106
115
  def rackup: (String path) -> untyped
107
116
  end
108
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Markin
@@ -161,10 +161,12 @@ files:
161
161
  - ext/kino/Cargo.toml
162
162
  - ext/kino/build.rs
163
163
  - ext/kino/extconf.rb
164
+ - ext/kino/src/control.rs
164
165
  - ext/kino/src/env_strings.rs
165
166
  - ext/kino/src/gvl.rs
166
167
  - ext/kino/src/lib.rs
167
168
  - ext/kino/src/logsink.rs
169
+ - ext/kino/src/mono.rs
168
170
  - ext/kino/src/pin.rs
169
171
  - ext/kino/src/queue.rs
170
172
  - ext/kino/src/registry.rs
@@ -180,15 +182,18 @@ files:
180
182
  - lib/kino/cli.rb
181
183
  - lib/kino/configuration.rb
182
184
  - lib/kino/errors_stream.rb
185
+ - lib/kino/hook_fire.rb
183
186
  - lib/kino/input.rb
184
187
  - lib/kino/logger.rb
185
188
  - lib/kino/null_input.rb
189
+ - lib/kino/quarantine_monitor.rb
186
190
  - lib/kino/ractor_supervisor.rb
187
191
  - lib/kino/server.rb
188
192
  - lib/kino/stream.rb
189
193
  - lib/kino/templates/kino.rb.tt
190
194
  - lib/kino/version.rb
191
195
  - lib/kino/worker.rb
196
+ - lib/kino/worker_hooks.rb
192
197
  - sig/kino.rbs
193
198
  homepage: https://github.com/yaroslav/kino
194
199
  licenses:
@@ -214,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
219
  - !ruby/object:Gem::Version
215
220
  version: '0'
216
221
  requirements: []
217
- rubygems_version: 4.0.10
222
+ rubygems_version: 4.0.16
218
223
  specification_version: 4
219
224
  summary: High-performance Ractor web server for Ruby.
220
225
  test_files: []