Skip to content

Commit 2077653

Browse files
committed
Remove unnecessary method
1 parent b4c20ac commit 2077653

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

kafka/conn.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,6 @@ def _read_bytes(self, num_bytes):
6161

6262
return resp
6363

64-
def _consume_response(self):
65-
"""
66-
This method handles the response header and error messages. It
67-
then returns the response
68-
"""
69-
log.debug("Expecting response from Kafka")
70-
# Read the size off of the header
71-
resp = self._read_bytes(4)
72-
73-
(size,) = struct.unpack('>i', resp)
74-
75-
# Read the remainder of the response
76-
resp = self._read_bytes(size)
77-
return str(resp)
78-
7964
##################
8065
# Public API #
8166
##################
@@ -100,8 +85,14 @@ def recv(self, request_id):
10085
Get a response from Kafka
10186
"""
10287
log.debug("Reading response %d from Kafka" % request_id)
103-
self.data = self._consume_response()
104-
return self.data
88+
# Read the size off of the header
89+
resp = self._read_bytes(4)
90+
91+
(size,) = struct.unpack('>i', resp)
92+
93+
# Read the remainder of the response
94+
resp = self._read_bytes(size)
95+
return str(resp)
10596

10697
def copy(self):
10798
"""

0 commit comments

Comments
 (0)