reduce memory copies when consuming kafka responses

This commit is contained in:
Evan Klitzke
2013-12-25 16:16:05 -08:00
parent a3066879d2
commit 7f1db1d346

View File

@@ -38,12 +38,9 @@ class KafkaConnection(local):
def _consume_response(self):
"""
Fully consumer the response iterator
Fully consume the response iterator
"""
data = ""
for chunk in self._consume_response_iter():
data += chunk
return data
return "".join(self._consume_response_iter())
def _consume_response_iter(self):
"""