Class: Artoo::Drivers::Pinger

Inherits:
Driver
  • Object
show all
Defined in:
lib/artoo/drivers/pinger.rb

Overview

Pings itself

Instance Attribute Summary

Attributes inherited from Driver

#parent

Instance Method Summary collapse

Methods inherited from Driver

#connection, #event_topic_name, #initialize, #interval, #method_missing, #pin

Methods included from Celluloid

#timers

Constructor Details

This class inherits a constructor from Artoo::Drivers::Driver

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Artoo::Drivers::Driver

Instance Method Details

#start_driverObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/artoo/drivers/pinger.rb', line 7

def start_driver
  @count = 1
  every(interval) do
    publish(event_topic_name("update"), "alive", @count)
    publish(event_topic_name("alive"), @count)
    @count += 1
  end

  super
end