code: function(reset) {
        var deferred = DeferredPromise();
        this.handle('close', deferred);
        return deferred.promise.then(() => {
          if (reset) {
            queues = [];
            exchanges = [];
          }
        });
      }
docs: Closes connection
  
  @public
  @memberOf ConnectionMachine.prototype
  @returns {Promise} promise that is fulfilled after connection has been closed