Sha256: a05673f343f4ed140ecfe07ee092ff77737e1237c7bd9124d1fedd60a170c6d8

Contents?: true

Size: 349 Bytes

Versions: 3

Compression:

Stored size: 349 Bytes

Contents

module PumaWorkerKiller
  class AutoReap
    def initialize(timeout, reaper = Reaper.new)
      @timeout = timeout # seconds
      @reaper  = reaper
      @running = false
    end

    def start
      @running = true

      Thread.new do
        while @running
          @reaper.reap
          sleep @timeout
        end
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puma_worker_killer-0.0.3 lib/puma_worker_killer/auto_reap.rb
puma_worker_killer-0.0.2 lib/puma_worker_killer/auto_reap.rb
puma_worker_killer-0.0.1 lib/puma_worker_killer/auto_reap.rb