Class: Fluent::UnitTimeFilterOutput::Buffer
- Inherits:
-
Object
- Object
- Fluent::UnitTimeFilterOutput::Buffer
- Includes:
- Enumerable
- Defined in:
- lib/fluent/plugin/unit_time_filter_buffer.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(options) ⇒ Buffer
constructor
A new instance of Buffer.
- #resume(tag, es) ⇒ Object
Constructor Details
#initialize(options) ⇒ Buffer
Returns a new instance of Buffer.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/fluent/plugin/unit_time_filter_buffer.rb', line 5 def initialize() @log = [:log] @fiber = Fiber.new do run() end # Step to `yield` @fiber.resume end |
Instance Method Details
#each ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fluent/plugin/unit_time_filter_buffer.rb', line 16 def each loop do tag, es = Fiber.yield break unless (tag && es) es.each do |time, record| yield([tag, time, record]) end end end |
#resume(tag, es) ⇒ Object
27 28 29 |
# File 'lib/fluent/plugin/unit_time_filter_buffer.rb', line 27 def resume(tag, es) @fiber.resume(tag, es) end |