'Consume quota.
Args:
amount: amount of quota to be consumed as int.
Returns:
True if quota was successfully consumed, False if there\'s not enough
quota.'

def consume(self, amount=1):

    while (self.quota < amount):
        delta = self.quota_manager.consume(self.bucket, self.batch_size, consume_some=True)
        if (not delta):
            return False
        self.quota += delta
    self.quota -= amount
    return True
