code: function setWait(attributes, interval, timeLimit, callback) {
    if (typeof timeLimit === 'function') {
      callback  = timeLimit;
      timeLimit = null;
    }
  
    var self  = this,
        start = Date.now(),
        fired = false,
        equalCheckId,
        current;
  
    equalCheckId = setInterval(function () {
      self.refresh(function (err, resource) {
  
        if (timeLimit) {
          current = Date.now();
          if (current - start > timeLimit) {
            clearInterval(equalCheckId);
            if (!fired) {
              fired = true;
              callback(err, resource);
              return;
            }
          }
        }
  
        if (err) {
          return;
        } // Ignore errors
  
        var equal = true,
            keys  = Object.keys(attributes);
  
        if (typeof attributes === 'function') {
          equal = attributes(resource);
        }
        else {
          for (var i = 0; i < keys.length; i++) {
            if (attributes[keys[i]] !== resource[keys[i]]) {
              equal = false;
              break;
            }
          }
        }
  
        if (equal) {
          clearInterval(equalCheckId);
          callback(null, resource);
        }
      });
    }, interval);
  
    return equalCheckId;
  }
docs: ### function setWait (attributes, interval, callback)  Continually polls resource and checks the results against the attributes parameter. When the attributes match the callback will be fired  e.g. server.setWait({ status: 'RUNNING' }, 5000, function (err, resource) { console.log('status is now running'); });  #### @attributes  {Object|Function}  Attributes to match. Optionally provide a matching function ####    @*        {*}       **Optional** Key and expected value #### @interval    {Integer} Time between pools in ms. #### @timeLimit   {Integer} **Optional** Max time to spend executing #### @callback {Function} f(err, resource).