Sha256: 99a236412d17a9ab512b826fa8a4d1f5ca48b81e5615cdbd4efb0629522dcb9c

Contents?: true

Size: 627 Bytes

Versions: 1

Compression:

Stored size: 627 Bytes

Contents

# -*- encoding: binary -*-
# :enddoc:
# This class handles the Unicorn fchmod heartbeat mechanism
# in Coolio-based concurrency models to prevent the master
# process from killing us unless we're blocked.  This class
# will also detect and execute the graceful exit if triggered
# by SIGQUIT
class Rainbows::Coolio::Heartbeat < Coolio::TimerWatcher
  KATO = Rainbows::Coolio::KATO
  CONN = Rainbows::Coolio::CONN
  G = Rainbows::G

  def on_timer
    if (ot = G.kato) >= 0
      ot = Time.now - ot
      KATO.delete_if { |client, time| time < ot and client.timeout? }
    end
    exit if (! G.tick && CONN.size <= 0)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rainbows-2.1.0 lib/rainbows/coolio/heartbeat.rb