def produce(topic, msg, key: nil)
      Rafka.wrap_errors do
        redis_key = "topics:#{topic}"
        redis_key << ":#{key}" if key
        @redis.rpushx(redis_key, msg.to_s)
      end
    end
def produce(topic, msg, key: nil)
      Rafka.wrap_errors do
        redis_key = "topics:#{topic}"
        redis_key << ":#{key}" if key
        @redis.rpushx(redis_key, msg.to_s)
      end
    end
Create a new producer.

 @param [Hash] opts
 @option opts [String] :host ("localhost") server hostname
 @option opts [Fixnum] :port (6380) server port
 @option opts [Hash] :redis Configuration options for the underlying
   Redis client

 @return [Producer]
 Produce a message to a topic. This is an asynchronous operation.

 @param topic [String]
 @param msg [#to_s] the message
 @param key [#to_s] an optional partition hashing key. Two or more messages
   with the same key will always be written to the same partition.

 @example Simple produce
   producer = Rafka::Producer.new
   producer.produce("greetings", "Hello there!")

 @example Produce two messages with a hashing key. Those messages are guaranteed to be written to the same partition
     producer = Rafka::Producer.new
     produce("greetings", "Aloha", key: "abc")
     produce("greetings", "Hola", key: "abc")