Close Channel on irc_amqp_listener termination.
authorMatt Mullins <mmullins@mmlx.us>
Sat, 4 May 2013 06:37:19 +0000 (23:37 -0700)
committerMatt Mullins <mmullins@mmlx.us>
Sun, 5 May 2013 07:30:36 +0000 (00:30 -0700)
commitbbe3789804b100542b1df0b248bcf16b111e71d5
tree1d0b007a9210b7c354881b095563912e8acade8f
parent082bd88460b2c5f46a6cc8f816c9f55b2c5729e0
Close Channel on irc_amqp_listener termination.

This fixes a bug wherein application:stop(irc) would leave a dangling Channel
that was consuming messages on a queue -- long after the process to which it
would deliver is dead.  That would cause the AMQP channel to exit with reason
unexpected_delivery_and_no_default_consumer, killing all of the rest of the
AMQP client and, by the transitive property of death, the irc application as
well.

The irc_amqp_listener must trap exits in order to receive a termination notice
from its supervisor.  I'm not actually sure if this has any implications for it
monitoring its AMQP Channel or not.
irc/irc_amqp_listener.erl
irc/irc_object_sup.erl