summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Ghishan <omar.ghishan@rd.io>2014-01-07 17:27:21 -0800
committerOmar Ghishan <omar.ghishan@rd.io>2014-01-07 17:35:01 -0800
commit20776539f0277cb09f7447ffefe440d1bf231ef4 (patch)
treedf009f9c2059e04b1c0d7f5c06851d0daf540428
parentb4c20acf2471a7cee23e4e2b7729a100da6c557b (diff)
downloadkafka-python-20776539f0277cb09f7447ffefe440d1bf231ef4.tar.gz
Remove unnecessary method
-rw-r--r--kafka/conn.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/kafka/conn.py b/kafka/conn.py
index 4749bdd..b2916ce 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -61,21 +61,6 @@ class KafkaConnection(local):
return resp
- def _consume_response(self):
- """
- This method handles the response header and error messages. It
- then returns the response
- """
- log.debug("Expecting response from Kafka")
- # Read the size off of the header
- resp = self._read_bytes(4)
-
- (size,) = struct.unpack('>i', resp)
-
- # Read the remainder of the response
- resp = self._read_bytes(size)
- return str(resp)
-
##################
# Public API #
##################
@@ -100,8 +85,14 @@ class KafkaConnection(local):
Get a response from Kafka
"""
log.debug("Reading response %d from Kafka" % request_id)
- self.data = self._consume_response()
- return self.data
+ # Read the size off of the header
+ resp = self._read_bytes(4)
+
+ (size,) = struct.unpack('>i', resp)
+
+ # Read the remainder of the response
+ resp = self._read_bytes(size)
+ return str(resp)
def copy(self):
"""