Module: Rackup::Handler::Raptor
- Defined in:
- lib/rackup/handler/raptor.rb
Overview
Rack handler for booting Raptor through Rackup, ‘rails server`, or any other host that follows the Rack handler protocol.
Constant Summary collapse
- DEFAULT_OPTIONS =
{ Host: "0.0.0.0", Port: 9292 }.freeze
Class Method Summary collapse
-
.run(app, **options) {|cluster| ... } ⇒ void
Boots a Raptor cluster serving the given Rack application.
-
.valid_options ⇒ Hash{String => String}
Returns the handler-specific options surfaced by ‘rackup –help`.
Class Method Details
.run(app, **options) {|cluster| ... } ⇒ void
This method returns an undefined value.
Boots a Raptor cluster serving the given Rack application.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rackup/handler/raptor.rb', line 25 def self.run(app, **) require_relative "../../raptor/cli" require_relative "../../raptor/cluster" cluster = ::Raptor::Cluster.new((app, )) yield cluster if block_given? cluster.run end |
.valid_options ⇒ Hash{String => String}
Returns the handler-specific options surfaced by ‘rackup –help`.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rackup/handler/raptor.rb', line 41 def self. { "Host=HOST" => "Hostname to listen on (default: #{DEFAULT_OPTIONS[:Host]})", "Port=PORT" => "Port to listen on (default: #{DEFAULT_OPTIONS[:Port]})", "Threads=NUM" => "Number of threads per worker (default: 3)", "Ractors=NUM" => "Number of pipeline ractors per worker (default: 1)", "Workers=NUM" => "Number of worker processes (default: nprocessors)", "Config=PATH" => "Load additional configuration from PATH" } end |