Sha256: fa5a2f092eaff52f23c630320a9cc8e99e88a45b01fefc6f89657561f9b32eb8

Contents?: true

Size: 608 Bytes

Versions: 11

Compression:

Stored size: 608 Bytes

Contents

# -*- encoding: binary -*-
module Rainbows
  module Rev

    # This class handles the Unicorn fchmod heartbeat mechanism
    # in Rev-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 Heartbeat < ::Rev::TimerWatcher

      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
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rainbows-0.94.0 lib/rainbows/rev/heartbeat.rb
rainbows-0.93.0 lib/rainbows/rev/heartbeat.rb
rainbows-0.92.0 lib/rainbows/rev/heartbeat.rb
rainbows-0.91.1 lib/rainbows/rev/heartbeat.rb
rainbows-0.91.0 lib/rainbows/rev/heartbeat.rb
rainbows-0.90.2 lib/rainbows/rev/heartbeat.rb
rainbows-0.90.1 lib/rainbows/rev/heartbeat.rb
rainbows-0.90.0 lib/rainbows/rev/heartbeat.rb
rainbows-0.9.0 lib/rainbows/rev/heartbeat.rb
rainbows-0.8.0 lib/rainbows/rev/heartbeat.rb
rainbows-0.7.0 lib/rainbows/rev/heartbeat.rb