class LogStash::Codecs::AutoFlush

Public Class Methods

new(mc, interval) click to toggle source
# File lib/logstash/codecs/auto_flush.rb, line 6
def initialize(mc, interval)
  @mc, @interval = mc, interval
  @stopped = Concurrent::AtomicBoolean.new # false by default
  @task = RetriggerableTask.new(@interval, self)
end

Public Instance Methods

start() click to toggle source
# File lib/logstash/codecs/auto_flush.rb, line 16
def start
  # can't start if pipeline is stopping
  return self if stopped?
  @task.retrigger
  self
end
stop() click to toggle source
# File lib/logstash/codecs/auto_flush.rb, line 27
def stop
  @stopped.make_true
  @task.close
end
stopped?() click to toggle source
# File lib/logstash/codecs/auto_flush.rb, line 23
def stopped?
  @stopped.value
end
timeout() click to toggle source
# File lib/logstash/codecs/auto_flush.rb, line 12
def timeout
  @mc.auto_flush
end