Sha256: 10abfca9fe113a55440be2e5a48bee581fecfdaca5a61a1c5a47fa7f79378ead

Contents?: true

Size: 709 Bytes

Versions: 16

Compression:

Stored size: 709 Bytes

Contents

# frozen_string_literal: true

module GoodJob
  class ProbeServer
    class WebrickHandler
      def initialize(app, options = {})
        @app    = app
        @port   = options[:port]
        @logger = options[:logger]
        @handler = ::Rack::Handler.get('webrick')
      end

      def stop
        @handler&.shutdown
      end

      def running?
        @handler&.instance_variable_get(:@server)&.status == :Running
      end

      def build_future
        Concurrent::Future.new(args: [@handler, @port, GoodJob.logger]) do |thr_handler, thr_port, thr_logger|
          thr_handler.run(@app, Port: thr_port, Host: '0.0.0.0', Logger: thr_logger, AccessLog: [])
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
good_job-3.29.4 lib/good_job/probe_server/webrick_handler.rb
good_job-3.29.3 lib/good_job/probe_server/webrick_handler.rb
good_job-3.28.2 lib/good_job/probe_server/webrick_handler.rb
good_job-3.28.1 lib/good_job/probe_server/webrick_handler.rb
good_job-3.28.0 lib/good_job/probe_server/webrick_handler.rb
good_job-3.27.4 lib/good_job/probe_server/webrick_handler.rb
good_job-3.27.3 lib/good_job/probe_server/webrick_handler.rb
good_job-3.27.2 lib/good_job/probe_server/webrick_handler.rb
good_job-3.27.1 lib/good_job/probe_server/webrick_handler.rb
good_job-3.27.0 lib/good_job/probe_server/webrick_handler.rb
good_job-3.26.2 lib/good_job/probe_server/webrick_handler.rb
good_job-3.26.1 lib/good_job/probe_server/webrick_handler.rb
good_job-3.26.0 lib/good_job/probe_server/webrick_handler.rb
good_job-3.25.0 lib/good_job/probe_server/webrick_handler.rb
good_job-3.24.0 lib/good_job/probe_server/webrick_handler.rb
good_job-3.23.0 lib/good_job/probe_server/webrick_handler.rb