class Puma::Single
This class is instantiated by the ‘Puma::Launcher` and used to boot and serve a Ruby application when no puma “workers” are needed i.e. only using “threaded” mode. For example `$ puma -t 1:5`
At the core of this class is running an instance of ‘Puma::Server` which gets created via the `start_server` method from the `Puma::Runner` class that this inherits from.
Public Instance Methods
Source
# File lib/puma/single.rb, line 41 def run output_header "single" load_and_bind Plugins.fire_background @launcher.write_state start_control @server = server = start_server server_thread = server.run log "Use Ctrl-C to stop" redirect_io @events.fire_on_booted! debug_loaded_extensions("Loaded Extensions:") if @log_writer.debug? begin server_thread.join rescue Interrupt # Swallow it end end
Source
# File lib/puma/single.rb, line 17 def stats { started_at: utc_iso8601(@started_at) }.merge(@server.stats).merge(super) end
@!attribute [r] stats
Calls superclass method
Puma::Runner#stats
Source
# File lib/puma/single.rb, line 35 def stop_blocked log "- Gracefully stopping, waiting for requests to finish" @control&.stop true @server&.stop true end