Class: LogStash::Util::WrappedSynchronousQueue::WriteBatch
- Inherits:
-
Object
- Object
- LogStash::Util::WrappedSynchronousQueue::WriteBatch
- Defined in:
- lib/logstash/util/wrapped_synchronous_queue.rb
Instance Method Summary collapse
- #each(&blk) ⇒ Object
-
#initialize ⇒ WriteBatch
constructor
A new instance of WriteBatch.
- #push(event) ⇒ Object (also: #<<)
- #size ⇒ Object
Constructor Details
#initialize ⇒ WriteBatch
Returns a new instance of WriteBatch.
295 296 297 |
# File 'lib/logstash/util/wrapped_synchronous_queue.rb', line 295 def initialize @events = [] end |
Instance Method Details
#each(&blk) ⇒ Object
308 309 310 311 312 |
# File 'lib/logstash/util/wrapped_synchronous_queue.rb', line 308 def each(&blk) @events.each do |e| blk.call(e) end end |
#push(event) ⇒ Object Also known as: <<
303 304 305 |
# File 'lib/logstash/util/wrapped_synchronous_queue.rb', line 303 def push(event) @events.push(event) end |
#size ⇒ Object
299 300 301 |
# File 'lib/logstash/util/wrapped_synchronous_queue.rb', line 299 def size @events.size end |