class FFWD::PluginChannel

A set of channels, one for metrics and one for events. This is simply a convenience class to group the channel that are available to a plugin in one direction (usually either input or output).

Attributes

events[R]
id[R]
metrics[R]
reporter_meta[R]

Public Class Methods

build(id) click to toggle source
# File lib/ffwd/plugin_channel.rb, line 35
def self.build id
  events = FFWD::Channel.new log, "#{id}.events"
  metrics = FFWD::Channel.new log, "#{id}.metrics"
  new id, metrics, events
end
new(id, events, metrics) click to toggle source
# File lib/ffwd/plugin_channel.rb, line 41
def initialize id, events, metrics
  @id = id
  @events = events
  @metrics = metrics
  @reporter_meta = {:channel => @id}
end

Public Instance Methods

event(event) click to toggle source
# File lib/ffwd/plugin_channel.rb, line 52
def event event
  @events << event
  increment :events
end
event_subscribe(&block) click to toggle source
# File lib/ffwd/plugin_channel.rb, line 48
def event_subscribe &block
  @events.subscribe(&block)
end
metric(metric) click to toggle source
# File lib/ffwd/plugin_channel.rb, line 61
def metric metric
  @metrics << metric
  increment :metrics
end
metric_subscribe(&block) click to toggle source
# File lib/ffwd/plugin_channel.rb, line 57
def metric_subscribe &block
  @metrics.subscribe(&block)
end