Class: EventHub::ActorWatchdog

Inherits:
Object
  • Object
show all
Includes:
Celluloid, Helper
Defined in:
lib/eventhub/actor_watchdog.rb

Overview

Watchdog class

Instance Method Summary collapse

Methods included from Helper

#create_bunny_connection, #get_name_from_class, #now_stamp, #stringify_keys

Constructor Details

#initializeActorWatchdog

Returns a new instance of ActorWatchdog.



10
11
12
13
# File 'lib/eventhub/actor_watchdog.rb', line 10

def initialize
  EventHub.logger.info("Watchdog is starting...")
  async.start
end

Instance Method Details

#cleanupObject



22
23
24
# File 'lib/eventhub/actor_watchdog.rb', line 22

def cleanup
  EventHub.logger.info("Watchdog is cleaning up...")
end

#startObject



15
16
17
18
19
20
# File 'lib/eventhub/actor_watchdog.rb', line 15

def start
  loop do
    watch
    sleep Configuration.processor[:watchdog_cycle_in_s]
  end
end