Sha256: 5961448f0447c9bb33d15cecf93e113e1eac246318931b8230bc9bf015b4ac87

Contents?: true

Size: 380 Bytes

Versions: 3

Compression:

Stored size: 380 Bytes

Contents

# frozen_string_literal: true

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
          sleep @timeout
          @reaper.reap
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puma_worker_killer-0.3.1 lib/puma_worker_killer/auto_reap.rb
puma_worker_killer-0.3.0 lib/puma_worker_killer/auto_reap.rb
puma_worker_killer-0.2.0 lib/puma_worker_killer/auto_reap.rb