class Puma::Server

def run(background=true, thread_name: 'srv')


are handled synchronously.
up in the background to handle requests. Otherwise requests
If +background+ is true (the default) then a thread is spun

Runs the server.
def run(background=true, thread_name: 'srv')
  BasicSocket.do_not_reverse_lookup = true
  @events.fire :state, :booting
  @status = :run
  @thread_pool = ThreadPool.new(thread_name, @options) { |client| process_client client }
  if @queue_requests
    @reactor = Reactor.new(@io_selector_backend) { |c| reactor_wakeup c }
    @reactor.run
  end
  @thread_pool.auto_reap! if @options[:reaping_time]
  @thread_pool.auto_trim! if @options[:auto_trim_time]
  @check, @notify = Puma::Util.pipe unless @notify
  @events.fire :state, :running
  if background
    @thread = Thread.new do
      Puma.set_thread_name thread_name
      handle_servers
    end
    return @thread
  else
    handle_servers
  end
end