Class: Woodhouse::Watchdog::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/woodhouse/watchdog.rb

Instance Method Summary collapse

Constructor Details

#initialize(watchdog, id = nil) ⇒ Client

Returns a new instance of Client.



121
122
123
124
# File 'lib/woodhouse/watchdog.rb', line 121

def initialize(watchdog, id = nil)
  @watchdog = watchdog
  @id = id || detect_id || Celluloid.uuid
end

Instance Method Details

#detect_idObject



126
127
128
# File 'lib/woodhouse/watchdog.rb', line 126

def detect_id
  Celluloid.current_actor.object_id
end

#report(name, message) ⇒ Object



130
131
132
133
134
# File 'lib/woodhouse/watchdog.rb', line 130

def report(name, message)
  if @watchdog
    @watchdog.report @id, Status.new(name, message)
  end
end