Module: Eye::Group::Call

Included in:
Eye::Group
Defined in:
lib/eye/group/call.rb

Instance Method Summary collapse

Instance Method Details

#break_chainObject



55
56
57
58
59
# File 'lib/eye/group/call.rb', line 55

def break_chain
  info 'break chain'
  scheduler_clear_pending_list
  @chain_breaker = true
end

#deleteObject



34
35
36
37
# File 'lib/eye/group/call.rb', line 34

def delete
  fast_call command: :delete
  terminate
end

#monitorObject



39
40
41
# File 'lib/eye/group/call.rb', line 39

def monitor
  chained_call command: :monitor
end

#restartObject



30
31
32
# File 'lib/eye/group/call.rb', line 30

def restart
  chained_call command: :restart
end

#send_call(call) ⇒ Object

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



4
5
6
7
8
9
10
11
12
13
14
15
# 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) ⇒ Object



47
48
49
# File 'lib/eye/group/call.rb', line 47

def signal(sig)
  fast_call command: :signal, args: [sig]
end

#startObject



22
23
24
# File 'lib/eye/group/call.rb', line 22

def start
  chained_call command: :start
end

#stopObject



26
27
28
# File 'lib/eye/group/call.rb', line 26

def stop
  fast_call command: :stop
end

#unmonitorObject



43
44
45
# File 'lib/eye/group/call.rb', line 43

def unmonitor
  fast_call command: :unmonitor
end

#update_config(cfg) ⇒ Object



17
18
19
20
# File 'lib/eye/group/call.rb', line 17

def update_config(cfg)
  @config = cfg
  @full_name = nil
end

#user_command(cmd) ⇒ Object



51
52
53
# File 'lib/eye/group/call.rb', line 51

def user_command(cmd)
  fast_call command: :user_command, args: [cmd]
end