Class: LogStash::OutputDelegatorStrategies::Single

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/output_delegator_strategies/single.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, metric, execution_context, plugin_args) ⇒ Single

Returns a new instance of Single.



2
3
4
5
6
7
# File 'lib/logstash/output_delegator_strategies/single.rb', line 2

def initialize(klass, metric, execution_context, plugin_args)
  @output = klass.new(plugin_args)
  @output.metric = metric
  @output.execution_context = execution_context
  @mutex = Mutex.new
end

Instance Method Details

#do_closeObject



19
20
21
22
# File 'lib/logstash/output_delegator_strategies/single.rb', line 19

def do_close
  # No mutex needed since this is only called when the pipeline is clear
  @output.do_close
end

#multi_receive(events) ⇒ Object



13
14
15
16
17
# File 'lib/logstash/output_delegator_strategies/single.rb', line 13

def multi_receive(events)
  @mutex.synchronize do
    @output.multi_receive(events)
  end
end

#registerObject



9
10
11
# File 'lib/logstash/output_delegator_strategies/single.rb', line 9

def register
  @output.register
end