code: function (interfaceCls, debug) {
    this.id = Consumer.nextId();
    this.interfaceCls = interfaceCls;
    this.debug = debug;
    util.handleEvents(this);
  
    this.ifaces = {};
    this.closeHandlers = {};
    this.errorHandlers = {};
    this.emits = {};
  }
docs: A freedom port for a user-accessable api.
  @class Consumer
  @implements Port
  @uses handleEvents
  @param {Object} interfaceCls The api interface exposed by this consumer.
  @param {Debug} debug The debugger to use for logging.
  @constructor