Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #127 from hamilyon/master

Improved transaction and confirm-mode send perfomance in blocking connection
  • Loading branch information...
commit daac34d4e1b5b7520f39521a7aa678d05ff63277 2 parents a317c6a + c256626
Gavin M. Roy authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 pika/adapters/blocking_connection.py
View
11 pika/adapters/blocking_connection.py
@@ -85,6 +85,15 @@ def _flush_outbound(self):
log.error(SOCKET_TIMEOUT_MESSAGE)
self._handle_disconnect()
+ def flush_outbound(self):
+ # Make sure we're open, if not raise the exception
+ if not self.is_open and not self.is_closing:
+ raise AMQPConnectionError
+ # Write our data
+ self._flush_outbound()
+ # Process our timeout events
+ self.process_timeouts()
+
def process_data_events(self):
# Make sure we're open, if not raise the exception
if not self.is_open and not self.is_closing:
@@ -244,7 +253,7 @@ def send_method(self, method, content=None, wait=True):
# Wait until the outbound buffer is empty
while self.connection.outbound_buffer.size > 0:
try:
- self.connection.process_data_events()
+ self.connection.flush_outbound()
except AMQPConnectionError:
break
Please sign in to comment.
Something went wrong with that request. Please try again.