Sha256: 89d4694efedfc59f5bfd70af1d29236c60b60cdbcb46eb0690e9abff3ef84659
Contents?: true
Size: 609 Bytes
Versions: 13
Compression:
Stored size: 609 Bytes
Contents
module BigBrother class Ticker def self.pause(&block) EM.cancel_timer(@timer) while @outstanding_ticks > 0 EM::Synchrony.sleep(0.1) end block.call schedule! end def self.schedule! @outstanding_ticks = 0 @timer = EM::Synchrony.add_periodic_timer(0.1, &method(:tick)) end def self.tick @outstanding_ticks += 1 BigBrother.clusters.ready_for_check.each do |cluster| BigBrother.logger.debug("Monitoring cluster #{cluster.name}") cluster.monitor_nodes end @outstanding_ticks -= 1 end end end
Version data entries
13 entries across 13 versions & 1 rubygems