lib/kafka/async_producer.rb in ruby-kafka-0.7.10 vs lib/kafka/async_producer.rb in ruby-kafka-1.0.0

- old
+ new

@@ -101,9 +101,12 @@ # @see Kafka::Producer#produce # @param (see Kafka::Producer#produce) # @raise [BufferOverflow] if the message queue is full. # @return [nil] def produce(value, topic:, **options) + # We want to fail fast if `topic` isn't a String + topic = topic.to_str + ensure_threads_running! if @queue.size >= @max_queue_size buffer_overflow topic, "Cannot produce to #{topic}, max queue size (#{@max_queue_size} messages) reached"