reduce memory copies when consuming kafka responses
This commit is contained in:
@@ -38,12 +38,9 @@ class KafkaConnection(local):
|
|||||||
|
|
||||||
def _consume_response(self):
|
def _consume_response(self):
|
||||||
"""
|
"""
|
||||||
Fully consumer the response iterator
|
Fully consume the response iterator
|
||||||
"""
|
"""
|
||||||
data = ""
|
return "".join(self._consume_response_iter())
|
||||||
for chunk in self._consume_response_iter():
|
|
||||||
data += chunk
|
|
||||||
return data
|
|
||||||
|
|
||||||
def _consume_response_iter(self):
|
def _consume_response_iter(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user