benjamin-hodgson / asynqp

An AMQP library for asyncio
MIT License
84 stars 29 forks source link

Added new exceptions and logic for reconnecting broken connections. #17

Closed lenzenmi closed 9 years ago

lenzenmi commented 9 years ago

Added new exceptions and logic to allow for designing programs that automatically reconnect on a lost connection

Added ConnectionClosedError and ConnectionLostError. ConnectionClosedError is raised when the connection is closed normally, ConnectionLostError is raised when the connection is lost unexpectedly. cleanup Send poison pill when the connection is closed so that cleanup methods (Channel.close, Connection.close, Consumer.cancel) do not block waiting for a message from the server on a closed connection. Fixes from experience with an actual example script consistently handle setting futures inside syncronizer when poison pill is swallowed