Class: InfluxDB::Metrics::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/influxdb/metrics/event.rb

Direct Known Subclasses

Controller, Model

Instance Method Summary collapse

Instance Method Details

#handle(name, id, start, finish, payload) ⇒ Object



16
17
18
# File 'lib/influxdb/metrics/event.rb', line 16

def handle(name, id, start, finish, payload)
  fail NotImplementedError, 'Must implment #handle'
end

#subscribeObject



6
7
8
9
10
# File 'lib/influxdb/metrics/event.rb', line 6

def subscribe
  ActiveSupport::Notifications.subscribe(subscribe_to) do |*args|
    handle(*args)
  end
end

#subscribe_toObject



12
13
14
# File 'lib/influxdb/metrics/event.rb', line 12

def subscribe_to
  fail NotImplementedError, 'Must implement #subscribe_to'
end