Raise when calling wait_for_confirms on a closed channel #428

Merged
merged 1 commit into from Jul 18, 2016

Projects

None yet

2 participants

@mitio
Contributor
mitio commented Jul 18, 2016 edited

I'm proposing this change based on the discussion and feedback I got in #425.

If a channel is already closed it will receive no new frames and waiting
for confirmations will most likely hang and timeout unless the frames
were somehow already received.

If one wishes to wait for confirmations it’s probably the case that the
user doesn’t expect the channel to be closed and we should notify them
about it by failing early. A channel might be closed by RabbitMQ in case
of a channel-level error for example due to a publishing error.

@mitio mitio Raise when calling wait_for_confirms on a closed channel
If a channel is already closed it will receive no new frames and waiting
for confirmations will most likely hang and timeout unless the frames
were somehow already received.

If one wishes to wait for confirmations it’s probably the case that the
user doesn’t expect the channel to be closed and we should notify them
about it by failing early. A channel might be closed by RabbitMQ in case
of a channel-level error for example due to a publishing error.
1b8601f
@michaelklishin michaelklishin self-assigned this Jul 18, 2016
@michaelklishin michaelklishin merged commit c0c1b0b into ruby-amqp:master Jul 18, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@michaelklishin
Member

Thank you!

@mitio mitio deleted the mitio:wait-for-confirms-raise-on-closed-channel branch Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment