class TrRMIte::Consumers::Console

Public Class Methods

new(topic, registry_uri) click to toggle source
Calls superclass method TrRMIte::Consumer::new
# File lib/TrRMIte/consumers/console.rb, line 5
def initialize(topic, registry_uri)
  super('CONSOLE_CONSUMER', topic, registry_uri)

  @processed_event_count = 0
  @max_event_count = ENV['MAX_EVENT_COUNT'].to_i
end

Private Instance Methods

process(event) click to toggle source
# File lib/TrRMIte/consumers/console.rb, line 14
def process event
  $stdout.puts event.to_json
  $stdout.flush

  @stop_processing = (@processed_event_count += 1) == @max_event_count
end