code: function Channel (handlers, worker) {
    this.handlers = handlers
    this.isClient = Boolean(worker)
    this.isWorker = !this.isClient
  
    // Is the comms channel open?
    this.open = defer()
  
    // Handlers for unknown message types
    this.receiveHandlers = []
  
    // Deferreds for sent messages so we can resolve
    // the promise if they receive a response
    this.promises = {}
  
    if (this.isClient) {
      this.open.resolve()
      this.recipient = worker
      this.messageChannel = new _MessageChannel()
      this.messageChannel.port1.onmessage = this._handleMessage.bind(this)
      this.send(msgr.types.CONNECT)
    } else {
      _self.onmessage = this._handleMessage.bind(this)
    }
  }
docs: --- Channel ---