squaremo/rabbit.js — pull request #43 by wolfeidau (2013-06-06 11:19:31+00:00)
Title: Added closing of exchanges.

So I was doing a lot of testing today with this library and noticed that channels were not being cleaned up when a socket was closed.

After digging around in the sources I noticed that the _advertisements was being set to an empty array but the exchange kept within wasn't being closed.

Once I added this close routine the channels were cleaned up properly.

That said I spent an hour this evening trying to write a test for it without success, it seems to be timing related thing, somewhere in the chain an async cleanup is happening.

I am hoping you know a way.