Sha256: e1f717139efec1767dcde18688846e216014608adc468636e795da3b67911206

Contents?: true

Size: 511 Bytes

Versions: 1

Compression:

Stored size: 511 Bytes

Contents

require "eventmachine-tail"

class Woodchuck::TailReader < EventMachine::FileTail

	attr_accessor :input_format, :output

	def self.static_init(input_format, output)
		@@input_format = input_format
		@@output = output
	end

	def initialize(path, startpos = -1)
		super(path, startpos)
		@input_format = @@input_format
		@output = @@output

		@buffer = BufferedTokenizer.new
	end

	def receive_data(data)
		@buffer.extract(data).each do |line|
			@output.handle(@input_format.create(path, line))
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
woodchuck-json-event-0.0.1 lib/woodchuck/tail_reader.rb