File tree Expand file tree Collapse file tree 1 file changed +8
-17
lines changed Expand file tree Collapse file tree 1 file changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -61,21 +61,6 @@ def _read_bytes(self, num_bytes):
61
61
62
62
return resp
63
63
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
-
79
64
##################
80
65
# Public API #
81
66
##################
@@ -100,8 +85,14 @@ def recv(self, request_id):
100
85
Get a response from Kafka
101
86
"""
102
87
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 )
105
96
106
97
def copy (self ):
107
98
"""
You can’t perform that action at this time.
0 commit comments