code: function setListener(callback) {
      if (onFinish) {
        throw new Error('thenDo/finally called more than once');
      }
      if (finished) {
        onFinish = function() {};
        callback(finished.err, finished.result);
      } else {
        onFinish = function() {
          callback(finished.err, finished.result);
        };
      }
    }
docs: Sets the listener that will be called with the result of this task, when
  finished. This function can be called at most once.
  
  @param {function(?, T)} callback