kino 0.6.0 → 0.7.1

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.
data/lib/kino.rb CHANGED
@@ -57,8 +57,12 @@ require_relative "kino/configuration"
57
57
  require_relative "kino/hook_fire"
58
58
  require_relative "kino/worker_hooks"
59
59
  require_relative "kino/worker"
60
+ require_relative "kino/slot_bank"
60
61
  require_relative "kino/ractor_supervisor"
62
+ require_relative "kino/threaded_pool"
63
+ require_relative "kino/monitor"
61
64
  require_relative "kino/quarantine_monitor"
65
+ require_relative "kino/pool_scaler"
62
66
  require_relative "kino/server"
63
67
 
64
68
  # Hand the frozen shareable singletons to the native layer: it sets them
@@ -9,13 +9,13 @@ module Rackup
9
9
  module Kino
10
10
  # Host option name => Kino setting plus the coercion it needs: rackup
11
11
  # hands `-O NAME=VALUE` values (and its own -p) over as strings.
12
- OPTION_MAP = {
12
+ OPTION_MAP = Ractor.make_shareable({
13
13
  Host: [:bind, ->(value) { value.to_s }],
14
14
  Port: [:port, ->(value) { Integer(value) }],
15
15
  Workers: [:workers, ->(value) { Integer(value) }],
16
16
  Threads: [:threads, ->(value) { Integer(value) }],
17
17
  Mode: [:mode, ->(value) { value.to_sym }]
18
- }.freeze
18
+ })
19
19
  private_constant :OPTION_MAP
20
20
 
21
21
  # Boot a server for `app` and block until it shuts down, the way the
@@ -27,7 +27,7 @@ module Rackup
27
27
  # want a handle on it
28
28
  # @return [::Kino::Server] the stopped server, after shutdown
29
29
  def self.run(app, **options)
30
- require "kino"
30
+ require "kino" # audition:disable runtime-require
31
31
  server = ::Kino::Server.new(app, **server_options(options))
32
32
  yield server if block_given?
33
33
  server.run
@@ -58,7 +58,7 @@ module Rackup
58
58
  # @param options [Hash{Symbol => Object}]
59
59
  # @return [Hash{Symbol => Object}]
60
60
  def self.server_options(options)
61
- require "kino"
61
+ require "kino" # audition:disable runtime-require
62
62
  options = options.dup
63
63
  host_defaults = {}
64
64
  if (typed = options.delete(:user_supplied_options))
data/sig/kino.rbs CHANGED
@@ -110,6 +110,8 @@ module Kino
110
110
  def bind: (String host) -> untyped
111
111
  def port: (int port) -> untyped
112
112
  def workers: (int count) -> untyped
113
+ def max_workers: (int count) -> untyped
114
+ def scale_down_after: (Numeric seconds) -> untyped
113
115
  def threads: (int count) -> untyped
114
116
  def mode: (Symbol | String mode) -> untyped
115
117
  def queue_depth: (int depth) -> untyped
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.6.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Markin
@@ -219,12 +219,16 @@ files:
219
219
  - lib/kino/input.rb
220
220
  - lib/kino/log.rb
221
221
  - lib/kino/logger.rb
222
+ - lib/kino/monitor.rb
222
223
  - lib/kino/null_input.rb
224
+ - lib/kino/pool_scaler.rb
223
225
  - lib/kino/quarantine_monitor.rb
224
226
  - lib/kino/ractor_supervisor.rb
225
227
  - lib/kino/server.rb
228
+ - lib/kino/slot_bank.rb
226
229
  - lib/kino/stream.rb
227
230
  - lib/kino/templates/kino.rb.tt
231
+ - lib/kino/threaded_pool.rb
228
232
  - lib/kino/version.rb
229
233
  - lib/kino/worker.rb
230
234
  - lib/kino/worker_hooks.rb
@@ -254,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
258
  - !ruby/object:Gem::Version
255
259
  version: '0'
256
260
  requirements: []
257
- rubygems_version: 4.0.16
261
+ rubygems_version: 4.0.20
258
262
  specification_version: 4
259
263
  summary: High-performance Ractor web server for Ruby.
260
264
  test_files: []