Class: Consumer
- Inherits:
-
EventMachine::FileTail
- Object
- EventMachine::FileTail
- Consumer
- Defined in:
- lib/logstash_sqs/consumer.rb
Instance Method Summary collapse
-
#initialize(path, startpos = -1,, params = {}) ⇒ Consumer
constructor
A new instance of Consumer.
- #receive_data(data) ⇒ Object
Constructor Details
#initialize(path, startpos = -1,, params = {}) ⇒ Consumer
Returns a new instance of Consumer.
3 4 5 6 7 8 |
# File 'lib/logstash_sqs/consumer.rb', line 3 def initialize(path, startpos=-1, params = {}) super(path, startpos) @buffer = BufferedTokenizer.new @aws_sqs_client = AWSSQS.new(params['buffer_size']) @format = params['format'] || 'json' end |
Instance Method Details
#receive_data(data) ⇒ Object
10 11 12 13 14 |
# File 'lib/logstash_sqs/consumer.rb', line 10 def receive_data(data) @buffer.extract(data).each do || @aws_sqs_client.(marshall()) end end |