Sha256: e79cce4119cc97bed2ca355ad3bb8f30b0bc7837a03a6b6ec544d82a396707c8

Contents?: true

Size: 368 Bytes

Versions: 7

Compression:

Stored size: 368 Bytes

Contents

require 'artoo/drivers/driver'

module Artoo
  module Drivers
    # Pings itself
    class Pinger < Driver
      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
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
artoo-0.4.0 lib/artoo/drivers/pinger.rb
artoo-0.3.0 lib/artoo/drivers/pinger.rb
artoo-0.2.0 lib/artoo/drivers/pinger.rb
artoo-0.1.3 lib/artoo/drivers/pinger.rb
artoo-0.1.2 lib/artoo/drivers/pinger.rb
artoo-0.1.1 lib/artoo/drivers/pinger.rb
artoo-0.1.0 lib/artoo/drivers/pinger.rb