Implement missing Connection.wait_for_response()
This commit is contained in:
@@ -199,6 +199,7 @@ class Connection(object):
|
||||
return
|
||||
self.is_closed = True
|
||||
|
||||
log.debug("Closing connection to %s" % (self.host,))
|
||||
if self._read_watcher:
|
||||
self._read_watcher.stop()
|
||||
if self._write_watcher:
|
||||
@@ -353,6 +354,9 @@ class Connection(object):
|
||||
self.push(msg.to_string(request_id, compression=self.compressor))
|
||||
return request_id
|
||||
|
||||
def wait_for_response(self, msg):
|
||||
return self.wait_for_responses(msg)[0]
|
||||
|
||||
def wait_for_responses(self, *msgs):
|
||||
waiter = ResponseWaiter(len(msgs))
|
||||
for i, msg in enumerate(msgs):
|
||||
|
||||
Reference in New Issue
Block a user