Class: Fluent::Test::Driver::MultiOutput
- Includes:
- EventFeeder
- Defined in:
- lib/fluent/test/driver/multi_output.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(klass, opts: {}, &block) ⇒ MultiOutput
constructor
A new instance of MultiOutput.
- #run(flush: true, **kwargs, &block) ⇒ Object
- #run_actual(**kwargs, &block) ⇒ Object
Methods included from EventFeeder
Methods inherited from BaseOwner
#configure, #emit_count, #emit_error_event, #emit_event_stream, #error_events, #event_streams, #events, #record_count
Methods inherited from Base
#break_if, #broken?, #configure, #end_if, #instance_hook_after_started, #instance_hook_before_stopped, #instance_shutdown, #instance_start, #stop?
Constructor Details
#initialize(klass, opts: {}, &block) ⇒ MultiOutput
Returns a new instance of MultiOutput.
28 29 30 31 32 |
# File 'lib/fluent/test/driver/multi_output.rb', line 28 def initialize(klass, opts: {}, &block) super raise ArgumentError, "plugin is not an instance of Fluent::Plugin::MultiOutput" unless @instance.is_a? Fluent::Plugin::MultiOutput @flush_buffer_at_cleanup = nil end |
Instance Method Details
#flush ⇒ Object
47 48 49 |
# File 'lib/fluent/test/driver/multi_output.rb', line 47 def flush @instance.outputs.each{|o| o.force_flush } end |
#run(flush: true, **kwargs, &block) ⇒ Object
34 35 36 37 |
# File 'lib/fluent/test/driver/multi_output.rb', line 34 def run(flush: true, **kwargs, &block) @flush_buffer_at_cleanup = flush super(**kwargs, &block) end |
#run_actual(**kwargs, &block) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/fluent/test/driver/multi_output.rb', line 39 def run_actual(**kwargs, &block) val = super(**kwargs, &block) if @flush_buffer_at_cleanup @instance.outputs.each{|o| o.force_flush } end val end |