Method: Kafka::AsyncProducer#shutdown

Defined in:
lib/kafka/async_producer.rb

#shutdownnil

Shuts down the producer, releasing the network resources used. This method will block until the buffered messages have been delivered.

Returns:

  • (nil)

See Also:



146
147
148
149
150
151
152
153
154
# File 'lib/kafka/async_producer.rb', line 146

def shutdown
  ensure_threads_running!

  @timer_thread && @timer_thread.exit
  @queue << [:shutdown, nil]
  @worker_thread && @worker_thread.join

  nil
end