code: function Deferred() {
      var self = this;
      self.promise = new Promise(function (resolve, reject) {
          self.resolve = resolve;
          self.reject = reject;
      });
  }
docs: BlueBird has made Promise.pending() obsolete, but that makes working with streams
  very difficult, so introducing a simple workaround.
  @constructor