Class: Fluent::OutputThread

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/output.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ OutputThread

Returns a new instance of OutputThread.



79
80
81
82
83
# File 'lib/fluent/output.rb', line 79

def initialize(output)
  @output = output
  @finish = false
  @next_time = Engine.now + 1.0
end

Instance Method Details

#configure(conf) ⇒ Object



85
86
# File 'lib/fluent/output.rb', line 85

def configure(conf)
end

#shutdownObject



94
95
96
97
98
99
100
101
# File 'lib/fluent/output.rb', line 94

def shutdown
  @finish = true
  @mutex.synchronize {
    @cond.signal
  }
  Thread.pass
  @thread.join
end

#startObject



88
89
90
91
92
# File 'lib/fluent/output.rb', line 88

def start
  @mutex = Mutex.new
  @cond = ConditionVariable.new
  @thread = Thread.new(&method(:run))
end

#submit_flushObject



103
104
105
106
107
108
109
# File 'lib/fluent/output.rb', line 103

def submit_flush
  @mutex.synchronize {
    @next_time = 0
    @cond.signal
  }
  Thread.pass
end