retupmoca / P6-Net-AMQP

MIT License
7 stars 4 forks source link

Do something when broker closes the channel #9

Closed jonathanstowe closed 8 years ago

jonathanstowe commented 8 years ago

Currently if the broker closes the channel for some reason (client error or something,) the "channel.close-ok" method is not acted upon, but no further messages will be received so potentially a client could be left hanging on a promise that will never be kept or waiting to process messages that will never be received.

I noticed this when testing 'ack' which doesn't appear to work in the case where the publisher and consumer are running in the same process.

I think this may be best served by simply having a "closed" Promise on Channel that is kept when it is closed somehow.