Sha256: 1ea5e51822302acab1520e01d9d61d3e1b97d26fba43105ad50be55791b9ae38
Contents?: true
Size: 1.23 KB
Versions: 3
Compression:
Stored size: 1.23 KB
Contents
module Eye::Controller::Commands # Main method, answer for the client command def command(cmd, *args) debug "client command: #{cmd} #{args * ', '}" start_at = Time.now cmd = cmd.to_sym res = case cmd when :start, :stop, :restart, :unmonitor, :monitor send_command(cmd, *args) when :delete exclusive{ send_command(cmd, *args) } when :signal signal(*args) when :load exclusive{ load(*args) } when :info info_string(*args) when :object_info info_data(*args) when :xinfo info_string_debug(*args) when :oinfo info_string_short when :quit quit when :check check(*args) when :explain explain(*args) when :match match(*args) when :ping :pong when :logger_dev Eye::Logger.dev else :unknown_command end GC.start info "client command: #{cmd} #{args * ', '} (#{Time.now - start_at}s)" res end private def quit info 'exiting...' delete sleep 1 Eye::System.send_signal($$) # soft terminate sleep 2 Eye::System.send_signal($$, 9) end def delete send_command(:delete) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
eye-0.2.1 | lib/eye/controller/commands.rb |
eye-0.2 | lib/eye/controller/commands.rb |
eye-0.1.11 | lib/eye/controller/commands.rb |