Class: Rdkafka::Producer

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_rdkafka2.rb,
lib/fluent/plugin/out_rdkafka.rb

Instance Method Summary collapse

Instance Method Details

#close(timeout = nil) ⇒ Object

return false if producer is forcefully closed, otherwise return true



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fluent/plugin/out_rdkafka2.rb', line 10

def close(timeout = nil)
  @closing = true
  # Wait for the polling thread to finish up
  # If the broker isn't alive, the thread doesn't exit
  if timeout
    thr = @polling_thread.join(timeout)
    return !!thr
  else
    @polling_thread.join
    return true
  end
end