module RedisHA::Router

Public Class Methods

start(host, port, options={}) click to toggle source
# File lib/redis_ha/router.rb, line 10
def self.start host, port, options={}, &block
  EM.epoll
  EM.run do
    trap("TERM") { stop }
    trap("INT")  { stop }

    EventMachine::start_server(host, port, RedisHA::Router::Connection, options[:debug]) do |serv|
      serv.instance_eval &block
    end
  end
end
stop() click to toggle source
# File lib/redis_ha/router.rb, line 22
def self.stop
  EventMachine.stop
end