Class: EventHub::ActorWatchdog
- Inherits:
-
Object
- Object
- EventHub::ActorWatchdog
- Includes:
- Celluloid, Helper
- Defined in:
- lib/eventhub/actor_watchdog.rb
Overview
Watchdog class
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize ⇒ ActorWatchdog
constructor
A new instance of ActorWatchdog.
- #start ⇒ Object
Methods included from Helper
#create_bunny_connection, #get_name_from_class, #now_stamp, #stringify_keys
Constructor Details
#initialize ⇒ ActorWatchdog
10 11 12 13 14 |
# File 'lib/eventhub/actor_watchdog.rb', line 10 def initialize cycle = Configuration.processor[:watchdog_cycle_in_s] EventHub.logger.info("Watchdog is starting [cycle: #{cycle}s]...") async.start end |
Instance Method Details
#cleanup ⇒ Object
23 24 25 |
# File 'lib/eventhub/actor_watchdog.rb', line 23 def cleanup EventHub.logger.info("Watchdog is cleaning up...") end |
#start ⇒ Object
16 17 18 19 20 21 |
# File 'lib/eventhub/actor_watchdog.rb', line 16 def start loop do watch sleep Configuration.processor[:watchdog_cycle_in_s] end end |