module Eye::Group::Call

Public Instance Methods

break_chain() click to toggle source
# File lib/eye/group/call.rb, line 55
def break_chain
  info 'break chain'
  scheduler_clear_pending_list
  @chain_breaker = true
end
delete() click to toggle source
# File lib/eye/group/call.rb, line 34
def delete
  fast_call command: :delete
  terminate
end
monitor() click to toggle source
# File lib/eye/group/call.rb, line 39
def monitor
  chained_call command: :monitor
end
restart() click to toggle source
# File lib/eye/group/call.rb, line 30
def restart
  chained_call command: :restart
end
send_call(call) click to toggle source

:update_config, :start, :stop, :restart, :unmonitor, :monitor, :break_chain, :delete, :signal, :user_command

# File lib/eye/group/call.rb, line 4
def send_call(call)
  info "call: #{call[:method]}"

  case call[:command]
    when :delete
      delete
    when :break_chain
      break_chain
    else
      user_schedule(call)
  end
end
signal(sig) click to toggle source
# File lib/eye/group/call.rb, line 47
def signal(sig)
  fast_call command: :signal, args: [sig]
end
start() click to toggle source
# File lib/eye/group/call.rb, line 22
def start
  chained_call command: :start
end
stop() click to toggle source
# File lib/eye/group/call.rb, line 26
def stop
  fast_call command: :stop
end
unmonitor() click to toggle source
# File lib/eye/group/call.rb, line 43
def unmonitor
  fast_call command: :unmonitor
end
update_config(cfg) click to toggle source
# File lib/eye/group/call.rb, line 17
def update_config(cfg)
  @config = cfg
  @full_name = nil
end
user_command(cmd) click to toggle source
# File lib/eye/group/call.rb, line 51
def user_command(cmd)
  fast_call command: :user_command, args: [cmd]
end

Private Instance Methods

fast_call(call) click to toggle source
# File lib/eye/group/call.rb, line 63
def fast_call(call)
  command = call[:command]
  args = call[:args]
  info "send to all processes #{command} #{args.present? ? args * ',' : nil}"

  @processes.each do |process|
    process.send_call(call) unless process.skip_group_action?(command)
  end
end