Sha256: 803086c017b2487a668aa95236ff2540dc6680bb6027c6b9132a92472fcf965d

Contents?: true

Size: 791 Bytes

Versions: 19

Compression:

Stored size: 791 Bytes

Contents

module RedisFailover
  # Runner is responsible for bootstrapping the Node Manager.
  class Runner
    # Launches the Node Manager in a background thread.
    #
    # @param [Array] options the command-line options
    # @note this method blocks and does not return until the
    #   Node Manager is gracefully stopped
    def self.run(options)
      options = CLI.parse(options)
      node_manager = NodeManager.new(options)
      trap_signals(node_manager)
      node_manager.start
    end

    # Traps shutdown signals.
    # @param [NodeManager] node_manager the node manager
    def self.trap_signals(node_manager)
      [:INT, :TERM].each do |signal|
        trap(signal) do
          node_manager.shutdown
        end
      end
    end
    private_class_method :trap_signals
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
spbtv_redis_failover-1.0.2.1 lib/redis_failover/runner.rb
nogara-redis_failover-1.0.6 lib/redis_failover/runner.rb
nogara-redis_failover-1.0.5 lib/redis_failover/runner.rb
nogara-redis_failover-1.0.4 lib/redis_failover/runner.rb
redis_failover-1.0.2 lib/redis_failover/runner.rb
nogara-redis_failover-1.0.2 lib/redis_failover/runner.rb
nogara-redis_failover-1.0.1 lib/redis_failover/runner.rb
redis_failover-1.0.1 lib/redis_failover/runner.rb
nogara-redis_failover-1.0.0 lib/redis_failover/runner.rb
redis_failover-1.0.0 lib/redis_failover/runner.rb
nogara-redis_failover-0.9.7.4 lib/redis_failover/runner.rb
nogara-redis_failover-0.9.7.3 lib/redis_failover/runner.rb
nogara-redis_failover-0.9.7.2 lib/redis_failover/runner.rb
redis_failover-0.9.7.2 lib/redis_failover/runner.rb
redis_failover-0.9.7.1 lib/redis_failover/runner.rb
nogara-redis_failover-0.9.7 lib/redis_failover/runner.rb
redis_failover-0.9.7 lib/redis_failover/runner.rb
redis_failover-0.9.6 lib/redis_failover/runner.rb
redis_failover-0.9.5 lib/redis_failover/runner.rb