Class: LogStash::Util::WrappedAckedQueue::WriteClient

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/util/wrapped_acked_queue.rb

Instance Method Summary collapse

Constructor Details

#initialize(queue) ⇒ WriteClient

Returns a new instance of WriteClient.



304
305
306
# File 'lib/logstash/util/wrapped_acked_queue.rb', line 304

def initialize(queue)
  @queue = queue
end

Instance Method Details

#get_new_batchObject



308
309
310
# File 'lib/logstash/util/wrapped_acked_queue.rb', line 308

def get_new_batch
  WriteBatch.new
end

#push(event) ⇒ Object Also known as: <<



312
313
314
315
316
317
# File 'lib/logstash/util/wrapped_acked_queue.rb', line 312

def push(event)
  if @queue.closed?
    raise QueueClosedError.new("Attempted to write an event to a closed AckedQueue")
  end
  @queue.push(event)
end

#push_batch(batch) ⇒ Object



320
321
322
323
324
325
326
327
# File 'lib/logstash/util/wrapped_acked_queue.rb', line 320

def push_batch(batch)
  if @queue.closed?
    raise QueueClosedError.new("Attempted to write a batch to a closed AckedQueue")
  end
  batch.each do |event|
    push(event)
  end
end