Sha256: d489c8c149ce0f41b4e2ebc15610703805e639d8b2f0ba896fa1668b3d38d82d

Contents?: true

Size: 560 Bytes

Versions: 1

Compression:

Stored size: 560 Bytes

Contents

module RedisFailover
  # Runner is responsible for bootstrapping the redis Node Manager.
  class Runner
    def self.run(options)
      options = CLI.parse(options)
      @node_manager = NodeManager.new(options)
      trap_signals
      node_manager_thread = Thread.new { @node_manager.start }
      node_manager_thread.join
    end

    def self.trap_signals
      [:INT, :TERM].each do |signal|
        trap(signal) do
          Util.logger.info('Shutting down ...')
          @node_manager.shutdown
          exit(0)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redis_failover-0.8.0 lib/redis_failover/runner.rb