code: function attachListener (msg, listener) {
    var attached = msg.__onFinished
  
    // create a private single listener with queue
    if (!attached || !attached.queue) {
      attached = msg.__onFinished = createListener(msg)
      attachFinishedListener(msg, attached)
    }
  
    attached.queue.push(listener)
  }
docs: Attach the listener to the message.
  
  @param {object} msg
  @return {function}
  @private