class LogStash::Inputs::BeatsSupport::CodecCallbackListener

Use the new callback based approch instead of using blocks so we can retain some context of the execution, and make it easier to test

Attributes

data[RW]
path[RW]

The path acts as the `stream_identity`, usefull when the clients is reading multiples files

Public Class Methods

new(data, hash, path, transformer, queue) click to toggle source
# File lib/logstash/inputs/beats_support/codec_callback_listener.rb, line 13
def initialize(data, hash, path, transformer, queue)
  @data = data
  @hash = hash 
  @path = path
  @queue = queue
  @transformer = transformer
end

Public Instance Methods

process_event(event) click to toggle source
# File lib/logstash/inputs/beats_support/codec_callback_listener.rb, line 21
def process_event(event)
  @transformer.transform(event, @hash)
  raise LogStash::Inputs::Beats::InsertingToQueueTakeTooLong if !@queue.offer(event)
end