From 6de8beea1f507f32d874a657ac3c16836164b980 Mon Sep 17 00:00:00 2001 From: schneems Date: Wed, 3 Feb 2016 17:21:25 -0600 Subject: [PATCH] Docs --- lib/puma/launcher.rb | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/puma/launcher.rb b/lib/puma/launcher.rb index 8ea68377..6071ba56 100644 --- a/lib/puma/launcher.rb +++ b/lib/puma/launcher.rb @@ -1,8 +1,29 @@ require 'puma/binder' module Puma + # Puam::Launcher is the single entry point for starting a Puma server based on user + # configuration. It is responsible for taking user supplied arguments and resolving them + # with configuration in `config/puma.rb` or `config/puma/.rb`. + # + # It is responsible for either launching a cluster of Puma workers or a single + # puma server. class Launcher - + # Returns an instance of Launcher + # + # +input_options+ A Hash of options that is supplied by a user, typically through + # a CLI. These options are evaluated and merged with other configuration such as + # `config/puma.rb` file to generate the configuration options needed to run a Puma server. + # + # +launcher_args+ A Hash that currently has one required key `:events`, this is expected to + # hold an object similar to an `Puma::Events.stdio`, this object will be responsible for + # broadcasting Puma's internal state to a logging destination. An optional key `:argv` can + # be supplied, this should be an array of strings, these arguments are re-used when restarting + # the puma server. + # + # Examples: + # + # options = { min_threads: 1, max_threads: 10 } + # Puma::Launcher.new(options, argv: Puma::Events.stdio).run def initialize(input_options, launcher_args = {}) @runner = nil @events = launcher_args[:events] or raise "must provide :events key"