added a send_messages api to KeyedProducer

Signed-off-by: Jordan Shaw <jordan@pubnub.com>
This commit is contained in:
Jordan Shaw
2014-12-15 15:56:02 -08:00
parent 02124907ff
commit d14552580c

View File

@@ -54,6 +54,10 @@ class KeyedProducer(Producer):
partitioner = self.partitioners[topic]
return partitioner.partition(key, self.client.get_partition_ids_for_topic(topic))
def send_messages(self,topic,key,*msg):
partition = self._next_partition(topic, key)
return self._send_messages(topic, partition, *msg,key=key)
def send(self, topic, key, msg):
partition = self._next_partition(topic, key)
return self._send_messages(topic, partition, msg, key=key)