Sha256: 36d345cf0f4bc15dd33ff947e6519205e93ec63419aa0ed45937e14b95c5726a

Contents?: true

Size: 697 Bytes

Versions: 30

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

module Nonnative
  class HTTPServer < Nonnative::Server
    def initialize(service)
      log = File.open(service.log, 'a')
      events = Puma::Events.new(log, log)
      @server = Puma::Server.new(app, events)

      super service
    end

    protected

    def perform_start
      server.add_tcp_listener '0.0.0.0', proxy.port
      server.run.join
    end

    def perform_stop
      server.stop(true)
    end

    def wait_start
      timeout.perform do
        super until server.running
      end
    end

    def wait_stop
      timeout.perform do
        super while server.running
      end
    end

    private

    attr_reader :queue, :server
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
nonnative-1.58.0 lib/nonnative/http_server.rb
nonnative-1.57.1 lib/nonnative/http_server.rb
nonnative-1.57.0 lib/nonnative/http_server.rb
nonnative-1.56.1 lib/nonnative/http_server.rb
nonnative-1.56.0 lib/nonnative/http_server.rb
nonnative-1.55.0 lib/nonnative/http_server.rb
nonnative-1.54.0 lib/nonnative/http_server.rb
nonnative-1.53.0 lib/nonnative/http_server.rb
nonnative-1.51.1 lib/nonnative/http_server.rb
nonnative-1.48.0 lib/nonnative/http_server.rb
nonnative-1.47.0 lib/nonnative/http_server.rb
nonnative-1.46.0 lib/nonnative/http_server.rb
nonnative-1.45.0 lib/nonnative/http_server.rb
nonnative-1.44.0 lib/nonnative/http_server.rb
nonnative-1.43.0 lib/nonnative/http_server.rb
nonnative-1.42.0 lib/nonnative/http_server.rb
nonnative-1.41.0 lib/nonnative/http_server.rb
nonnative-1.40.0 lib/nonnative/http_server.rb
nonnative-1.39.0 lib/nonnative/http_server.rb
nonnative-1.38.0 lib/nonnative/http_server.rb