ruby-amqp / bunny

Bunny is a popular, easy to use, mature Ruby client for RabbitMQ
Other
1.39k stars 303 forks source link

Ensure that a connection that detects connectivity issues is transitioned into the "closed" state #561

Closed michaelklishin closed 6 years ago

michaelklishin commented 6 years ago

Currently when a heartbeat is detected, Bunny::Session could be left in a state other than "closed". Even if connection recovery is underway, the correct state for such connection is nonetheless "closed".

With this change Bunny::Session#send_frameset_without_timeout and friends could then throw a ConnectionClosedError which would be visible to clients. This is closer to how some other clients (e.g. Java) work.

@acogoluegnes @lukebakken FYI.

michaelklishin commented 6 years ago

Credit where credit is due: this was originally suggested in #560.